Which programming language do I go with?
June 3, 2011 7:39 AM   Subscribe

Confused with so many programming language options. Which one should I choose?

Am planning to get back to programming after a hiatus of over a decade. The last time I did it it was with C++, trying to create a game for a school project using DJGPP (there, dated myself) and Allegro.

The past few weeks I've looked at many other languages - Python (did some Project Euler problems in it and enjoyed it), Ruby (MacRuby and Rails is what really attracts me to this), R (not a programming language, but would love the data ninja chops), J (wow, not man enough for this yet), Racket LISP (interesting but what are the practical applications for this), Perl (still relevant. Seems to have gone very quiet in comparison to a decade ago??)

What I want to use this language (once I really start using it ) is for many purposes - data analysis tasks, working on more Project Euler problems, creating a webapp using a web framework to creating GUI apps for the Mac

What programming resources do I need? I'm not a fan of the "hello, world" pedagogy and find that creating something practical while simultaneously learning works best for me. A close example is the "head First" series. It would also be great if there are resources that teach programming fundamentals such as data structures and concepts such as recursion while keeping the "What does it do and what can it be used for" question in mind

What kind of community would be nice? One that is vibrant and has email lists that are open to stupid newbie questions is a must. Also, if there are open-source projects using the language that beginners can lurk on and learn more, that would be a very big plus point

Any suggestions, hivemind?
posted by epiphinite to Education (19 answers total) 26 users marked this as a favorite
 
I'd stick with your first choice, Python. If you would rather skip over the "hello, world" part of learning, you could dive right in with:

Learn Python The Hard Way
posted by purephase at 7:54 AM on June 3, 2011 [2 favorites]


I really like Dive into Python 3 as a way of learning the core Python language and the important builtin libraries. Regardless of what language you pick, you are going to have to learn some other library to do GUIs and web apps. In the case of GUIs its quite possible that the underling tech could be the same (QT, Tk, etc.) and you'd only have to learn the perl/python/ruby bindings. There is a lot more variation in web frameworks but I did like The Django Book for learning Django. I believe it might also be structured in the "let's slowly build and refine something as we go approach" that you like.
posted by mmascolino at 7:58 AM on June 3, 2011 [1 favorite]


Python, Ruby, and Perl are the ones that would work for all your purposes. C++ is even better for data analysis, but not so good for web programming. Racket is great for Project Euler, but not so much for anything else, no my knowledge, because it doesn't have the libraries. I've never used J.

A few specific recommendations in Python: for data analysis, look into Numpy, Scipy, and Matplotlib; for GUIs, look into WxPython; and for web apps, look into Django.
posted by d. z. wang at 7:58 AM on June 3, 2011 [1 favorite]


Yup, Python's a great first language. I learned with John Zelle's Python Programming: An Introduction to Computer Science, which contains great explanations and has you writing non-trivial programs almost immediately.
posted by randomname25 at 7:59 AM on June 3, 2011


There's not really one language to rule them all. Each domain you're talking about (data analysis, project euler, webapps, mac gui apps) have different needs and different languages that are best adapted to them. If you're adamant about learning one language that's broadly applicable, Python is probably your best bet. I don't think it's the best at any of those domains, but it's decent at all of them.

Ruby would be decent, too. It's known as a web language because of rails, but it's all-in-all a much cleaner and well designed language than Python in my opinion. But it's not nearly as widely used so you'll have a bit more trouble getting libraries you want (like Numpy or Matplotlib) to work nicely with it.
posted by heresiarch at 8:02 AM on June 3, 2011


heresiarch: "There's not really one language to rule them all."

Completely agreed. I spend most of my time in Mono/.NET, but just started with Erlang for a specialized web server. I haven't gotten very far with it yet, but if you're interested in Project Euler, you can easily see how learning functional programming makes solving those kinds of problems more straightforward.

I'm going to toss out Objective-C as an option. I have minimal personal experience with it, but it's the lingua franca of iPhone app development, which is a hot space right now.

You also can't go wrong with Python. Django's pretty great because you get a command line and can just start creating persistent objects right there if you want to monkey around.
posted by mkultra at 8:18 AM on June 3, 2011


R will be pretty straightforward to pickup once you've gotten your head around the basics of procedural languages. It's actually a fairly simple language and reminds me a lot of using Pascal (I think it's the <>short summary of some of the gotchas in the language.
posted by bonehead at 8:41 AM on June 3, 2011


Sorry: short summary
posted by bonehead at 8:42 AM on June 3, 2011


I think that to some degree, it depends on what you plan on using it for.

If you're looking to find gainful employment in programming in general, you're probably still best served by learning Java. At least at the moment.

If you want to do mobile apps, it's Objective-C/Cocoa for the iphone (and, Mac stuff in general), and Java for the other platforms.

If you want to do web stuff, Python and Ruby are great choices. But, every language is represented in a web stack somewhere. Also, knowing javascript is key if you're doing any kind of sophisticated web app, and you want fancy stuff in the browser. (Check out Douglas Crockford's talks/tutorials for JS knowledge.)

Seems like these days, knowing one language isn't enough. I end up bouncing around 3-4 different ones in every project.
posted by Citrus at 8:48 AM on June 3, 2011


Response by poster: Thanks for all the language suggestions so far - Python seems to be trending. I think the greatest attraction of Python for me was the pseudo-language and the large number of libraries that seem to be available. There also seems to be RPy for integrating with R, which I would still like to learn as SciPy, NumPy are overkill for the basic statistical/econometric analyses that I do. And yes, Django fills the blanks for the webapp side.

The book suggestions are great - I'm going to take a deep look at John Zelle's book recommended by randomname25 as well as Learn Python The Hard Way recommended by purephase. Has anybody used this Pragmatic Programmers Book and has an opinion on it as well? It's half the price of the Zelle book and seems to cover the same ground?

Does anyone know of other video/graphical resources like Google Python Class that are useful as well? Any recommendations on learning using P2PU? Finally, is there a StackOverflow-type website for programming newbies? I just find it too intimidating for that purpose despite the anonymity of the internet
posted by epiphinite at 8:51 AM on June 3, 2011


Finally, is there a StackOverflow-type website for programming newbies? I just find it too intimidating for that purpose despite the anonymity of the internet

Well if it was all newbies that would be the blind leading the blind. StackOverflow's biggest strength is that the upvoted answers tend to be the ones that fall under the "best practices" for that particular problem, and it covers a wide variety of problems. If you are stuck on a particular issue, looking at related topics on StackOverflow will point you in the right direction.
posted by burnmp3s at 9:16 AM on June 3, 2011


I learn by doing, so it is best for me to pick a language that feels good. If the language feels good, I'm up for more programming and exploring and trying things.

This is subjective. Ruby feels good to me.
posted by krilli at 9:59 AM on June 3, 2011


If you're going to use R, look into Sweave. The closest I can describe it is literate programming---you write a report in LaTeX while embedding R code that gets executed to inline certain results or plots into the resulting document. There's something magical about realizing you missed a constant, fixing it, and then watching all your other figures update themselves. Now, if only it could rewrite my analysis too...
posted by d. z. wang at 10:08 AM on June 3, 2011 [1 favorite]


I'm working my way through Learn Python the Hard Way right now. The only reason I went with Python was because of a local group offering a daylong intro course. It could just be my location, but it seems like the Python community is super enthusiastic and supportive. I wish I could find an R group like that in LA.
posted by mandymanwasregistered at 11:47 AM on June 3, 2011


Download Scala plugins for an IDE and start writing a Scala program? i do think that more programmers should be exposed to functional languages, simply because of the neat features they miss out on when using the traditional OO languages like Java. There was one Android application we were required to debug. All event handler classes for Android were defined as separate classes which became annoying quickly when I had to scroll up and down, and back and forth between pages. Plus Scala goes where the JVM goes and it is possible to write Android applications using Scala and using the ProGuard to trim any unused Scala libraries.

Learn to use anonymous classes in Java. Learn to use anonymous functions in other languages. Interfaces can be objects, and child classes can modify implementations of the parent class without ever needing to name the class. If you had the choice between Ruby and python, I would say go with Ruby. Python's support for anonymous functions seem to be limited and the writer seems to not want to even talk about tail-call optimization or tail recursion.
posted by DetriusXii at 1:42 PM on June 3, 2011


There's not really one language to rule them all.

Python comes pretty darn close. I only use other languages when I have special requirements (usually speed).
posted by Tell Me No Lies at 2:01 PM on June 3, 2011


Step one: which language is your job asking you to code in?

If not that, then:

Step one: which language do you have the most real-time help available for? That is, what languages are known well by the people you know well, so they can help you?
posted by davejay at 2:21 PM on June 3, 2011


Response by poster: Thanks for the further suggestions - I agree that it seems best to go with the language that feels right. Both Ruby and Python feel right to me. I'm leaning towards Python as that seems to have far more paths to go down and far more in terms of learning resources. Any suggestions on good learning resources - online/book/video that I should consider?

Thanks for all the inputs guys and girls
posted by epiphinite at 1:33 AM on June 4, 2011


I think Ruby is a great choice. It is good for slinging data around, has more momentum in the web arena than Python, and with macruby reaching 1.0 shortly, it is becoming a decent choice for OSX UI development (though you'll still need to learn enough Objective-C to slog through the Cocoa documentation).
posted by stp123 at 1:43 PM on June 5, 2011


« Older Middle Eastern food at home.   |   ARG, I just want to refactor without using my... Newer »
This thread is closed to new comments.