Habba
Posts: 3
Joined: Tue Oct 01, 2013 12:23 pm

Python VS Java

Tue Oct 01, 2013 12:37 pm

Hi everyone!

I need your advice on a project me and my group have to do for our CS course. The goal is to build an autonomous zeppelin, using a Pi with camera as the main control center. We are free in our choice for a programming language, and that's what my question is about.

We are trying to decide between Python and Java. We all have quite some experience in making a large software system in Java, but only a few of us have used Python to make small scale projects.

The software will use the GPIO pins for motor control, and for a distance sensor. It will also have to be capable of using WiFi, and will need to do some image processing, mainly for QR codes.

The materials we have are: RasPi Model A (since it uses less power), 4 motors, motor control panel, distance sensor, RasPi camera and a WiFi USB dongle.

We have gotten the Pi to work, we set up the WiFi and have used the sensor with both Java and Python (code for Python is at goo.gl/X9ot8j and for Java at goo.gl/dpOsxb). We used R to visualize the java data, since it saves to a .cvs file.

What would you recommend?

Cheers!
Habba

OtherCrashOverride
Posts: 582
Joined: Sat Feb 02, 2013 3:25 am

Re: Python VS Java

Tue Oct 01, 2013 2:02 pm

Habba wrote:What would you recommend?
That's easy. Go with what you already know so you can focus on accomplishing the project instead of learning a new language.

Garord
Posts: 2
Joined: Fri May 18, 2018 2:32 pm
Location: Iowa,Des Moines
Contact: Website

Re: Python VS Java

Fri May 18, 2018 2:36 pm

What attracts me to Python for my analysis work is the "full-stack" of tools that are available by virtue of being designed as a general purpose language vs. R as a domain specific language. The actual data analysis is only part of the story, and Python has rich tools and a clean full-featured language to get from the beginning to the end in a single language (use of C/Fortran wrappers notwithstanding).

On the front end, my work commonly starts with getting data from a variety of sources, including databases, files in various formats, or web scraping. Python support for this is good and most database or common data formats have a solid, well-maintained library available for the interface. R seems to share a general richness for data I/O, though for FITS the R package appears not to be under active development (no release of FITSio in 2.5 years?). A lot of the next stage of work typically occurs in the stage of organizing the data and doing pipeline-based processing with a lot of system-level interactions.

On the back end, you need to be able present large data sets in a tangible way, and for me, this commonly means generating web pages. For two projects I wrote significant Django web apps for inspecting the results of large Chandra survey projects. This included a lot of scraping (multiwavelength catalogs) and so forth. These were just used internally for navigating the data set and helping in source catalog generation, but they were invaluable in the overall project.

Moving to the astronomy-specific functionality for analysis, it seems clear that the community is solidly behind Python. This is seen in the depth of available packages and level of development activity, both at an individual and institutional level (http://www.astropython.org/resources). Given this level of infrastructure that is available and in work, I think it makes sense to direct effort to port the most useful R statistical tools for astronomy to Python. This would complement the current capability to call R functions from Python via rpy2.If you are interested, I strongly recommend that you read this article, here it is a question of comparing programming languages https://diceus.com/what-technology-is-b ... nd-java-r/ I hope it helps.Good Luck

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20512
Joined: Sat Jul 30, 2011 7:41 pm

Re: Python VS Java

Fri May 18, 2018 3:15 pm

Did you read the date of the post you replied to? 5 years old! I doubt anyone in that thread is still here to read it.

Locking as unnecessary thread necro - second one today.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

ejolson
Posts: 1902
Joined: Tue Mar 18, 2014 11:47 am

Re: Python VS Java

Sat May 19, 2018 5:28 pm

Garord wrote:
Fri May 18, 2018 2:36 pm
What attracts me to Python for my analysis work is the "full-stack" of tools that are available by virtue of being designed as a general purpose language vs. R as a domain specific language.
Welcome to the forum!

You've presented a nicely thought out argument for Python. Even though the person who originally posted has likely graduated with a CS degree by now, chances are someone else will come across this thread and benefit from all the points of view presented. In one case that person is me.

Forums such as this one, while not exactly Wikipedia, do accumulate knowledge over time.

In my opinion, it is often worth contributing to older threads because of the way search engines will lead people with similar issues to then no matter how old they are. When I've had difficulties with programs like Firefox or tmux, threads that are 10 years old have helped me sort things--sometimes a long-standing broken-by-design issue for which the developers have refused to accept existing patches.

Return to “General programming discussion”

Who is online

Users browsing this forum: No registered users and 4 guests