useful programming languages to learn?


by Arsenic&Lace
Tags: languages, learn, programming
Arsenic&Lace
Arsenic&Lace is offline
#1
Dec27-12, 04:34 PM
P: 255
The universe keeps (emphatically) yowling at me to learn a progamming language. As part of my research in computational biophysics I'm attempting to learn python as rapidly as possible. But I'm trying to figure out which languages are most useful to learn, and which languages I should learn, since the universe has also rudely informed me that my odds of becoming a researcher in physics are somewhere between 0 and 1, but waaay closer to 0 than 1.

C and C++ are mentioned frequently. My father is a bit eccentric but he makes his bread by programming in Scheme and feeding it to a C interpreter while working for a big tech giant. He vigorously suggests I learn scheme.

Any others? Would two languages suffice (C, python and scheme)?
Phys.Org News Partner Science news on Phys.org
Cougars' diverse diet helped them survive the Pleistocene mass extinction
Cyber risks can cause disruption on scale of 2008 crisis, study says
Mantis shrimp stronger than airplanes
Saladsamurai
Saladsamurai is offline
#2
Dec27-12, 04:44 PM
Saladsamurai's Avatar
P: 3,012
Hi A & L

Honestly, I would think that learning to program very well in just one language would be sufficient. It is much less important which language you use. They all do the same things, they just use different "words" to do them. Once you know how to program in one language, it is relatively easy to switch to a new one.

That being said, sometimes learning two different languages will help you to understand programming concepts better. Seeing the way each language handles things can give you a lot of insight. Kind of like using two textbooks to learn a new subject (which I also recommend).

I think since you have a head start on Python, you should stick to it. C++ is also a good one, but if you think your dad will be a good resource in learning, then maybe the second language should be Scheme.

Best of Luck!
bcrowell
bcrowell is offline
#3
Dec27-12, 06:31 PM
Emeritus
Sci Advisor
PF Gold
bcrowell's Avatar
P: 5,500
Saladsamurai's remarks are bang on.

Quote Quote by Saladsamurai View Post
That being said, sometimes learning two different languages will help you to understand programming concepts better. Seeing the way each language handles things can give you a lot of insight. Kind of like using two textbooks to learn a new subject (which I also recommend).
The nice thing about doing some C is that it get you close to the hardware and lets you understand how certain things work that are hidden from you in a language like python. Scheme might help you to learn a style of looking at programming called functional programming: http://www.defmacro.org/ramblings/fp.html . C++ is a horrible, ugly, badly designed language that was scarred for life by design constraints such as the desire to make it backward-compatible with C.

Quote Quote by Saladsamurai View Post
I think since you have a head start on Python, you should stick to it.
Yes. Many people who get through an undergrad CS curriculum actually can't program their way out of a paper sack in *any* language. Learn how to program in one language, python, and you're one up on them.

Arsenic&Lace
Arsenic&Lace is offline
#4
Dec27-12, 10:26 PM
P: 255

useful programming languages to learn?


Thanks guys! I'm actually quite fascinated by this point of view that many CS majors can't program worth beans, it seems utterly unexpected. A lot of my physics friends are panicking that they won't stand a chance against a full blown CS major, but I suppose I can tell them otherwise...
cgk
cgk is offline
#5
Dec28-12, 12:41 AM
P: 404
As others have commented, what you really want to learn is /programming/, not a programming language. And if you go into a field with "computational" in its name, you'd better learn it good. In order to become a decent programmer, you generally have to be "fluent" in multiple languages, as different languages are good for different problem domains. And in order to be a good programmer, you have to be at least a decent computer scientist (that means you need to know at least all the stuff taught in a BS course in Comp Sci, in particular algorithms and data structures to get started)

The most useful languages if doing numerics are likely Python or Matlab (choose one), C++, and C or Fortran (choose one). You should not start with C[1] or Fortran, as starting with either one will make you learn bad programming habits. You should start with Python, as this has the best effort-to-outcome ratio, and even when knowing only Python, you can get quite far. But you should be aware that there are things which simply cannot be done with it, many of which are important in fields with "computational" in their name.

About scheme: While scheme and common lisp are undoubtedly very powerful programming languages, you need to be aware that about 95% of the stuff they are good at can be done just as well in python (and much cleaner), and that if you seriously try to use them, you will quickly learn that you have to re-invent every single wheel (unlike in Python) and that you will be the only one in your lab using those languages. If you have some time, learn a LISP dialect by applying it to some toy project. It is fun and will make you grow as a programmer. But those are not good languages for everyday use, and nothing to get started with.


[1] (as most of C is a subset of C++, learning C is mostly a question of learning how the C++ constructs are actually implemented. Pure C itself is redundant.)


Edit: Yes, C++ is a horrible abomination straight out of hell (it is also a good example how you can arrive at a horrible result by doing only perfectly reasonable decisions.). However, it is still by far the best language for many kinds of applications, in particular all applications which call for *both* a software design (i.e., large applications) and raw performance (you can 100% performance in C++ if you know what you are doing). Most big applications in Windows, including Windows itself, are written in C++. There are good reasons for that.
cobalt124
cobalt124 is offline
#6
Dec28-12, 08:39 AM
PF Gold
cobalt124's Avatar
P: 144
Python is the best place to learn programming, then you can move on to which ever language you please. I don't know what your level your programming expertise is, but Coursera will be running at least three free online Python courses in the next two or three months, two provided by University of Toronto (a "the very basics" type course and a "crafting quality code" type course), and one provided by Rice University (event driven programming and object oriented programming). Unless of course you have already taken them as they ran this autumn as well.
bcrowell
bcrowell is offline
#7
Dec28-12, 09:42 AM
Emeritus
Sci Advisor
PF Gold
bcrowell's Avatar
P: 5,500
Quote Quote by Arsenic&Lace View Post
Thanks guys! I'm actually quite fascinated by this point of view that many CS majors can't program worth beans, it seems utterly unexpected. A lot of my physics friends are panicking that they won't stand a chance against a full blown CS major, but I suppose I can tell them otherwise...
http://www.codinghorror.com/blog/200...s-program.html

http://codility.com/c/run/demo8ERZEP-A5Q
jtbell
jtbell is offline
#8
Dec28-12, 11:12 AM
Mentor
jtbell's Avatar
P: 11,251
For the record, I did the FizzBuzz program (from Ben's first link) in C++ in nine minutes. If I hadn't succumbed to "oh gee, maybe this would be a better way to do it" after I was halfway through, I would have finished in five minutes.
PhilosophyofPhysics
PhilosophyofPhysics is offline
#9
Dec28-12, 01:25 PM
P: 98
Udacity is a good place to learn python.
Arsenic&Lace
Arsenic&Lace is offline
#10
Dec29-12, 10:03 PM
P: 255
Quote Quote by cgk View Post
About scheme: While scheme and common lisp are undoubtedly very powerful programming languages, you need to be aware that about 95% of the stuff they are good at can be done just as well in python (and much cleaner), and that if you seriously try to use them, you will quickly learn that you have to re-invent every single wheel (unlike in Python) and that you will be the only one in your lab using those languages. If you have some time, learn a LISP dialect by applying it to some toy project. It is fun and will make you grow as a programmer. But those are not good languages for everyday use, and nothing to get started with.

Do you think co-learning scheme while focusing most of my efforts on python would be a good idea? I was told that scheme will alter the way I think about solving many problems.
Dick
Dick is offline
#11
Dec30-12, 12:09 AM
Sci Advisor
HW Helper
Thanks
P: 25,174
Quote Quote by Arsenic&Lace View Post
Do you think co-learning scheme while focusing most of my efforts on python would be a good idea? I was told that scheme will alter the way I think about solving many problems.
I think you should concentrate on python to learn programming in general if you are new to programming. Co-learning anything else is fine. But if you don't get python you probably won't get anything else.
Arsenic&Lace
Arsenic&Lace is offline
#12
Dec30-12, 10:52 PM
P: 255
Ah okay, so far python is a breeze but it may just be I'm not pushing hard enough/working on any interesting projects.
Dick
Dick is offline
#13
Dec30-12, 11:01 PM
Sci Advisor
HW Helper
Thanks
P: 25,174
Quote Quote by Arsenic&Lace View Post
Ah okay, so far python is a breeze but it may just be I'm not pushing hard enough/working on any interesting projects.
That's probably the point about python. It is easy. It has sort of a minimum of syntactic formality about it and it's expressive. Take a python program and try to translate it into say, C++. Using STL classes will probably make it not that hard, but it's definitely a challenge.
streeters
streeters is offline
#14
Dec31-12, 03:15 AM
P: 221
To throw a cat amongst these pigeons, I think Java would be a good language to learn after Python.

This is because it is purely object-oriented and will teach you good project design. Its major limitation is its slow processing speed, but this is less of an issue nowadays than it used to be.

I am not a strong programmer, but I learnt on java and can still knock out useful code when I need to (this being said, i use python scripts daily)
Arsenic&Lace
Arsenic&Lace is offline
#15
Dec31-12, 11:02 AM
P: 255
I've heard from some that object-oriented programming is overrated. Is this true?
streeters
streeters is offline
#16
Dec31-12, 11:05 AM
P: 221
Quote Quote by Arsenic&Lace View Post
I've heard from some that object-oriented programming is overrated. Is this true?
it's main strength is when coding in a group, so you can write code that uses someone else's code without needing to see their code.

I guess it would be overrated if you were involved in every aspect of the project and weren't worried about other people being able to use your code.
jedishrfu
jedishrfu is offline
#17
Dec31-12, 12:04 PM
P: 2,489
Since you mentioned using you're programming for computational biophysics then I'd suggest Java and by extension Groovy. Groovy is fairly new to the scene. Its a scripting language based on java using java syntax, able to call upon java classes and fully interoperate with java without the hard requirement of using the class structure for your program. It also supports functional programming.

I've used groovy with the Java Open Source Physics library (www.compadre.org/osp) as part of a graduate level computational physics course and it worked quite well.

Groovy is also the base language for Grails, a web application framework with backing database which could be useful as your get further along in your project and you need to export results to the web for others to work with. That route would extend you into the realm of javascript and HTML using jquery, jsxgraph and other notable software.

If you do go this route then I'd also suggest Eclipse or Netbeans IDE tools as they make life of a programmer more bearable and productive.

More info on groovy can be found at: http://groovy.codehaus.org/

and grails at: http://grails.org/
jim mcnamara
jim mcnamara is offline
#18
Dec31-12, 12:46 PM
Sci Advisor
PF Gold
P: 1,355
[1] (as most of C is a subset of C++, learning C is mostly a question of learning how the C++ constructs are actually implemented. Pure C itself is redundant.)
This is a great way to start a flame war. Let's NOT do that, please.

Consider another idea:

Maybe you can think of programming languages like this: a few have become well-adapted (analalgous to Natural Selection and Adaptation) to particular niches. Example: C is mandatory if you want to do UNIX system programming or UNIX/Linux kernel development.

COBOL is likely never going away, no matter what you may think of it. These niche languages are not likely to fade away because MEL is cooler'n all-get-out, or Numpy is your idea of perfection because GSL sucks, and Mathematica and Maple cost too much.

There has been a proliferation of programming tools, languages, and dialects. Some new entries will fade, others will find a niche and become another de facto standard.

to the OP:
Pick a language - one - that has been around for a while. Learn that really well.
You would far better off longterm to pick a language that has a standards group (e.g., ISO) behind it.


Register to reply

Related Discussions
About programming languages. Career Guidance 17
What languages to learn for Game Development? Career Guidance 8
Which programming languages might a physics major learn and why? Academic Guidance 28
Useful languages to learn in college Academic Guidance 5
Programming Languages Programming & Computer Science 19