Page 1 of 1

Language Choice

Posted: Sun Aug 10, 2014 5:44 pm
by Rakuen Growlithe
For some of my future studies I'm going to need to learn to use mysql and a scripting language. The guy who's going to be training me suggested that knowing Perl, Python or Java would be beneficial. I'm not too familiar with the different languages so I wanted to see what you guys think is the best to learn. I'll need to use these for scientific computing.

I'm thinking of trying Codecadamy to learn the scripting language. Coursea also has courses dedicated to Python but doesn't have for the other languages, so I'm currently leaning towards Python.

Re: Language Choice

Posted: Sun Aug 10, 2014 6:17 pm
by Leeward
If you haven't coded much, I would recommend Python first. It is a lot easier to learn because its syntax is flexible and more forgiving, and also more similar to natural language. It has a huge amount of extensions and libraries that come with so much boilerplate code you just have to string everything together. If you can think of any even slightly generic thing to do, it probably already exists. Also Python is general-purpose which means it can be used as object-oriented or functional, and it treats functions as first-class objects (meaning you can pass them as arguments). It uses dynamic typing which can be confusing but also very useful. It also has a lot more built-in types such as sets, tuples and dictionaries. It is fantastic for scientific computing with numpy. There is a massive amount of tutorials for Python available online as well.

However if you like defining everything and making complicated structures that do only exactly what you tell them to, go for Java, which is more strict with typing (unless you use hierarchies and generics). It is entirely object-based though, and does not treat functions as first-class objects. Java, unlike Python, cannot shorten things by aliasing names, so it tends to be long-winded. Also it is sometimes unclear whether things are objects or pointers, so you might get some accidental aliasing if you're not careful. Java has a built-in class for database interfacing which is fairly easy to use.

I have never used Perl, so I can't give an opinion on it unfortunately.

So yeah it comes down to your personal preference, but if this is your first or second language I would recommend Python over Java.

Re: Language Choice

Posted: Sun Aug 10, 2014 7:11 pm
by Rakuen Growlithe
Reasoning would also be nice if you vote. For example I've heard a big advantage of Java is it works on all sorts of devices. For what I need it for that's irrelevant. It'll only be used on proper computers, most likely those running Linux.

On a side note apparently both Java and Python can be used in R, which is a good thing in my mind. So, Perl does kinda seem dead in the water. Apparently LibreOffice is also planning to replace it's Java use with Python.

Re: Language Choice

Posted: Sun Aug 10, 2014 8:32 pm
by Sev
Python is interpreted, and Java uses the JVM - therefore, compatibility is not a concern in either case.

The reason that I voted for Java is because becoming familiar with it would more easily allow you to branch to other major languages, like C#. Python is its own beast, and, in my mind at least, is more of a scripting language than a true programming language. Plus, I hate only using indentation to denote scope.

I would recommend using C#. It's less verbose than Java, and has a similiar level of support. If you want to develop in Linux with C#, use MonoDevelop.

Re: Language Choice

Posted: Sun Aug 10, 2014 8:37 pm
by Rakuen Growlithe
I specifically need a scripting language, these are the three that were recommended. I'm not really familiar with the differences and I haven't actually started any of the training yet. I think most of the use will be pulling information from databases/websites and then manipulating it. It's not really about creating new programmes.

Re: Language Choice

Posted: Sun Aug 10, 2014 8:47 pm
by Leeward
If it's for scripting then I would recommend Python even more strongly.

Re: Language Choice

Posted: Fri Nov 07, 2014 8:52 pm
by Rakuen Growlithe
Well I've now, after a big gap in the middle, finished the entire Codecademy Python course. I feel pretty good about that. I also took a Coursera course on the R statistical language, so that's two basic introduction to two different programming languages. We'll see if it helps.

Re: Language Choice

Posted: Fri Nov 07, 2014 9:21 pm
by Sev
Learn Haskell next; you'll thank me!