views:

183

answers:

12

I'm a chemistry major with limited experience in programming. I've done a few things mostly in VB.Net in the past but I'm interested in learning a new language. I've started learning C++ but I was wondering if it's a good choice in my field.

I can imagine that some programming experience would be useful in almost any field but I don't know what language I should focus on. Any advice?

Thanks

+1  A: 

What do you want to program? Each language has a specific target. Perl is great for text manipulation. Lua and C++ are great for games. Java, Python, Ruby, PHP are great for webpages. Some languages are more general than others, e.g. Java, Python, Ruby.

Java is C++ with rounded edges. I recommend either that or Ruby.

mcandre
Java is C++ with rounded edges!?! Sorry, I don't agree at all.
Konrad
Compare the syntax. http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B#Language_features
mcandre
Python is also great for computational chemistry, which is the field I work in. Most of the chemist-oriented tools have a Python interface.
Andrew Dalke
+6  A: 

Python is a great beginner language, and there are some pretty good online books on learning it. You'll probably want version 2.x instead of 3.x, because most libraries you'll be using probably haven't migrated to 3.x yet.

For learning material, check out "Dive into Python"

Alex Bliskovsky
Will check it out - nice that there's an online version.
Radu
Python is also widely used in computational chemistry (structure visualization, molecular modeling, and cheminformatics).
Andrew Dalke
+1  A: 

Java is a nice starting point and would be useful in your field. Do you have any experience in MATLAB or mathcad?

null_radix
I've got 0 experience with either of those. The closest for me has been Maple I guess.
Radu
I think you should learn java first, but it wouldn't be a bad idea to get into MATLAB. MATLAB is much more powerful and more flexible than maple. Also you can use java in MATLAB.
null_radix
Oh also Maple has interfaces for Java and MATLAB
null_radix
A: 

Radu, these days a little inclination towards rich internet application gives you a better chance to make your career better. As you mentioned that you have a Vb.Net exp, I suggest going to WPF/Silverlight way. You will have a little learing curve and wil soon land up in a booming career.

anand
I'm not looking to make a career out of programming, but I am interested in acquiring better tools for research in chemistry. I'm going in my 3rd year of undergrad. I've got some experience with web dev, mostly asp.net, php and drupal.
Radu
+2  A: 

I'd suggest learning either Java or C#. I expect you'll be using programming to crunch data of some kind. Both Java and C# are fast, and they have lots of libraries to do the things you'll probably encounter.

Also, since you're relatively new to programming, you won't need to jump into memory management and things like that that you'd have to do in C++.

It might also make sense to get familiar with MATLAB or Mathematica. Both are very geared towards doing large number crunching tasks.

However, while languages have their strengths/weaknesses, Norman's answer should also be considered: what are all your (chemistry-major) friends using? This way you'll learn from them and you'll be able to share and collaborate.

Jon Smock
So basically C++ is overkill?
Radu
Also, I've noticed that no one has said that VB.Net is good enough :P. I've read that with the .NET framework VB and C# are pretty much equivalent in terms of performance, but differ in syntax. Is this true or is C# more powerful and a better tool in general?
Radu
C++ would be valuable, but I don't think the benefits would outweigh the disadvantage of having to learn all that low-level stuff at the same time you're learning to program. VB.NET would be ok, but my impression is that things are moving away from that (just my impression - might not be reality). Learning C# rather than VB would also allow you to make a smoother transition to any language that shares a similar syntax (like Java, Javascript, C/C++, etc - there are a lot)
Jon Smock
+2  A: 

Fortran and Matlab would be good if you wanna to work on simulation. There are quiet a few existing codes and libraries. C++ and Java should be also good to pick.

lcmtwn
In terms of syntax is most similar to Matlab?
Radu
+2  A: 

Your best choice is almost certainly whatever your chemistry-major friends are using. In this case it might be Matlab, which is widely used in both natural sciences and engineering.

Norman Ramsey
This is a good point, since 1) it'll make learning the language easier, 2) you can work together/share work, and 3) they possibly already did this research and settled on that language for a reason
Jon Smock
The only way this helps Radu is that he can ask them for help programming.
mcandre
+1  A: 

I'd suggest FORTRAN. You'll find it all over the world in laboratories and other scientific institutions. All the other suggestions here are good suggestions, but if you have to pick only one, that'd be it.

Brian Hooper
I hesitate with FORTRAN because it feels antique, but what do I know :P
Radu
Look into Fortress in the sun labs
Woot4Moo
It is antique. That doesn't matter if it's widely used. (There's a new standard out recently but there will be huge amounts of code written to the 77 standard, and some probably still to the 66).
Brian Hooper
A: 

I don't want to get drawn into a language war here, but I'd say learn C++. It is an excellent language - very fast and very powerful. The best part however, is that once you know and are comfortable with C++ learning (almost all) other languages is very easy.

Konrad
Oh, what a surpise, a -1. If you are going to down vote me please share your rationale.
Konrad
Surprise?! "C++ is an excellent language" is good example of FUD and nothing else. In the last sentence the phrase in brackets should be not "almost all" but "some languages as "excellent" as C++".
kemiisto
I fail to see how saying C++ is an excellent language is FUD. Care to enlighten me?!
Konrad
+1  A: 

I'd suggest Python. It's easy to learn and has very good library support for scientific programming such as Scipy/Numpy. It has a good support community and it very good for churning out code quickly.

kobrien
A: 

Radu, i suggest having a look at Python, Perl or Ruby.

Please don't get this wrong, but it is unlike that you'll develop a fully-fledged quantumchemical package in the near future. (Neither will i). Thus, FORTRAN and C, while definitely not dead languages in chemistry, shouldn't be your first choice.

But you'll be using existing applications, e.g. Gromacs (written in C), Gaussian (written in FORTRAN), MOPAC, PLATON, etc and you might be interested to generate input files, parse the output and visualize the results.

Consequently, interpreted languages, particularly when supporting regular expressions, input and output of csv files and coming with plotting libraries will be more useful in your studies.

Klaus Warzecha