Blog bleg: Help me pick a language

by Erica Sadun

I've dabbled in Perl, messed with csh, but I always seem to come back to C (and her sisters) and Smalltalk. Now I have a little space in my life to learn a new language. Help me figure out where I should direct my energy and let me know why this will take me to new and important places development-wise. Thanks!



48 Comments

Chris Adamson
2007-04-23 14:13:46
I added LISP. If you get LISP, I mean really get LISP, it will change the way you think about coding, the relationship between code and data (like, not seeing them as different things), and make you seem ultra super cool to the uber-geeks. You also won't be able to do anything genuinely practical with it. ;-)
Erica Sadun
2007-04-23 14:17:34
Thanks Chris, but (mapcar 'beenthere '(done that)). I've lisped and prologed and even (during one dark time) APLed. I'm looking for something more current and important. I know it's probably a Python/Ruby tossup but I'd love to hear from people who care passionately.
Juan Pablo Claude
2007-04-23 14:42:36
I vote for Python. Ruby is a nice language too, but Python has a huge library of modules for doing just about anything. Also, if you want to do web application development with a framework similar to Ruby on Rails, you can do it with Django (among others).
William D. Neumann
2007-04-23 15:03:45
So what are you hoping to gain from learning this new language? That'll probably be the most important thing guiding the selection process. Honestly, I'd put Ruby and Python both way down the list, as they don't really bring anything new or interesting to the table. Ruby's nice, but it's not going to give you much of anything that Smalltalk doesn't already. And Python... well, to my mind at least, I'm not sure that there's a more boring language that's been developed since the glory days of COBOL.


So... what are you hoping to get out of this?


2007-04-23 15:05:32
Ruby, because that's what I'm trying to learn.


Based on Matt Neubergs's comments I thought it would be better than AppleScript directly, but maybe you're not even a Mac persion. If I understand it correctly (and I'm not a programmer, I'm a dabler--is that a word?), Ruby and Rails are separate, Ruby is a scripting language that uses Rails to build websites.

dylanjames
2007-04-23 15:14:46
I added Objective C because it's very Mac-relevant, and in many ways is a twist on Smalltalk, though recently has added nice things from Java (exceptions), and has quite a few things hitherto unknown ("Categories"). Especially when it gets garbage collection in 10.5, it will be very approachable by intermediate-level programmers. Apologies if it counts as one of "her sisters".


Python and Ruby are both increasing in their degree of Mac relevance as of 10.5 as well, by becoming full-fledged peers of Applescript in the OSAScripting world, as shipped by Apple.


If you're open-minded enough to consider LISP, maybe Haskell is worth looking into as well.

mark
2007-04-23 15:55:12
Unless your goal is simply to add another language you "know" to a list on your resume, you're taking an entirely worthless approach.


You can "dabble" and "mess with" all the languages under the sun, but unless you have the experience and know-how to quickly and efficiently get the job done using best practices and style... your time was wasted.


If you have a particular goal, choose a language suitable for that goal. If not, pick a language (why not start with one you already "know"?) and spend more time working with it and its popular libraries/modules.


Approaching this issue any other way is just baiting flames.

jils
2007-04-23 16:26:58
I vote for Objective C (particularly Cocoa). It is powerful, fast, and you can jump right in with a good book and XCode to build great OS X software.
Erica Sadun
2007-04-23 18:07:37
So what am I going after? A new skill set. Something to take me to new places I have not yet explored. I know that Ruby on Rails will take me webwards and Ruby/Python will take me towards scripting. Unfortunately, I do have limited time so I need to put the effort and focus on only one language.


By the way, I know Prolog and had way back when programmed extensively in it for (believe it or not) a business system. It's a very strange place to take one's mind.


I'm not at all familiar with Erlang and not entirely sure I'd take much advantage of concurrent programming. Still http://www.erlang.org/ is pretty cool.

Kevin Ollivier
2007-04-23 18:07:58
I've been coding with Python for 6-7 years now, and these days I feel bummed whenever I have to work in other languages. :-) As someone already mentioned, the large number of existing (and included) modules are a huge plus when you need to get something done - I feel more like I'm integrating modules rather than writing code.


I won't say much to compare the two (last thing I'd want to do is get into a language syntax war!), but since you mentioned you want to hear from those who prefer a particular language... ;-) I personally find that on the whole, Python coders have a more consistent style and thus I find it easier to read and understand others' code than I do in other languages. (This is, of course, partially due to forced indenting and a tendency to focus on explicit declaration rather than implicit behaviors.) Personally, though, I think the language enforcing consistency can be a good thing when you consider the whole community of coders, and the need to be able to work with code written by others. I also have to agree with the "executable pseudocode" meme that lots of people point out. The focus on natural language (as opposed to use of symbols like ~!@$&%) means that I have an easier time remembering the commands I need, which really sped up the learning curve and reduces the need to look things up in the pocket reference. Some would argue you spend more time typing, but I think on the whole the extra typing offers more benefits (e.g. clarity and maintainability) than drawbacks.


Also, I have to advertise that I help out on the wxPython (http://www.wxpython.org) project and IMHO it's about the best toolkit for cross-platform GUI app development out there, if you're interested in delving into that. Ruby and other languages have wxWidgets bindings too, but I think the wxPython bindings are the most complete, and to top it off, many members of the wxPython community have stepped in and contributed new controls and examples in Python. We try hard not to make cross-platform about "lowest common denominator" functionality and support, and I personally feel you can create very Mac friendly applications using it. (Disclaimer: I've been using a Mac full-time since 2003!)


Well, anyway, as you can tell by the gushing I'd say I'm a very satisfied Python programmer. :-) I suspect you could probably get grounded in the basics with a day or two of playing around, so I don't think you'd have to put in a huge time investment to determine if you'd like it or not. Then, you might even still have time to play with Ruby too... ;-)

David
2007-04-23 18:08:38
I guess if I was learning a language now-a-days, I'd pick Python or Ruby. Object oriented. Popular. Skip Php. I thought that would be fun, but once a website starts to become big, it ends up being a pretty cumbersome language.


However, I've always liked Perl. Perl can be written in an object oriented style or as loose as all get out. Variables can be created on the fly, treated as objects in one context, and then switched to a functional context. The looseness allows for a lot of power. I've written entire websites using mod_perl and CGI Perl scripting, and I actually prefer Perl over Php for this type of purpose.


How can you not want to learn a language where you can have a program that looks like http://99-bottles-of-beer.net/language-perl-737.html?

Erica Sadun
2007-04-23 18:25:40
Kevin: I've always felt "natural" language (and I'm looking at you AppleScript) is a detriment but sometimes you've got to force yourself to go into uncomfortable areas because there's something good to learn there. Ruby, Python and Perl are pretty much standard with OS X, so they all have a base advantage language-wise. I've been dabbling with Perl for a year or two without really making a huge effort to learn it, but one of the things that drives me nuts is that you've got to get into the CPAN grove to get anything real done. Everything is knowing which library to download and install, which makes portability a big issue. But Perl, as David will probably agree, takes me to amazing places in terms of parsing data, scraping the web and transforming information. I can throw together simple scripts that allow me to leverage regular expressions and greplike searches to pull information from many diverse places. If I decide to go forward with Perl it would be to gain some grace with the language which to date, I've merely hacked (as regular readers of this blog have seen from my code examples).


I haven't even touched Python or Ruby and would really like to know what places those two languages specialize in and where they'll take me.


Rob Rix
2007-04-23 19:01:17
Io, because it's incredibly dynamic.


D, because it's possibly the last compiled language you'll need to learn.


JavaScript, because of the whole web thing.


R, because it is just so incredibly powerful for working with, well, anything else. (Statistics can make a lot of difference in programming, and can be a lot of fun for nerds like us (: )

Rob Rix
2007-04-23 19:01:55
Oh yes, and Objective-C because it's beautiful, builds on what you know, and loves the Mac.

2007-04-23 20:08:56
Ruby, because that's what I'm trying to learn.


Based on Matt Neubergs's comments I thought it would be better than AppleScript directly.

William
2007-04-23 20:22:35
I found Python to be very similar to C for some reason. Maybe it was just the way I learned it, but it seemed like C in scripting language clothing. If you'd like to tinker more in the object-oriented realms, Ruby shares similar object-oriented concepts with Smalltalk and Objective-C. I especially found the developer community with Ruby to be easy to follow along with.


Strictly comparing Ruby and Python, I've found Python to be more robust of an environment than Ruby (which is still single-threaded), but I've found the Ruby's developer community to be a fun place to stick my brain for a few hours a week.

Chris Johnston
2007-04-23 21:09:47
I would say, based on your interest in SmallTalk, definitely go with Ruby. Once you get past learning the language there are a lot of really interesting computer science type things that people are starting to do with Ruby like meta-programming (check out Ruby on Rails). Plus, I believe that Ruby is the language of the future. Also, you can use Ruby to control AppleScript and do really cool Unix type things.
Kevin Ollivier
2007-04-23 21:33:22
I've always felt "natural" language (and I'm looking at you AppleScript) is a detriment but sometimes you've got to force yourself to go into uncomfortable areas because there's something good to learn there.


I'm happy to say that Python doesn't go into the realm of trying to write code as English sentences, like AppleScript does. :-) The actual programming constructs themselves are similar to JavaScript, Perl, Ruby, etc.


I just meant to say that other scripting languages tend to give special meaning to symbols like @, $, etc., whereas Python tends to use terms instead, like the keyword "global" to declare a variable as global. In Ruby for example, "myVar" is local and "$myVar" is global. Similarly, for class vars, Ruby would use @myVar (instance) or @@myVar (class/static), whereas you could just use "self.myVar" in Python. I find the Python versions are easier to read, and more importantly, remember, for those who don't aim to become a guru in the language. :-) (Consider also that if you know/use other languages, symbols like $ and @ may mean different things there.)


As for the domains of Python, I personally use Python for writing GUI applications, console applications, CGI apps, and throwaway scripts to automate a task, and have had good experiences in all those areas (I've even done things like called an application's AppleScript API, or COM objects on Win, from Python with an addon module). It's certainly not a perfect language (none are), but I don't remember feeling like the language was holding me back when I tried to move into a different area. That being said, it's true that I've not done things like try to write an AJAX web app with it, although I've heard good things about Django.

David
2007-04-23 22:44:38
What's your goal? I can never learn anything unless I have a project. If you're building a website, you're looking at Perl, Python, Ruby or (ick) PHP. I'm wrapping up a website where I used a lot of Python for the first time, and I'm really happy with it; can't wait to learn more.
grrr
2007-04-23 22:51:17
Not ruby. Despite its popularity . A lot of it's user are just stupid louthmouth's and it is a real dissapointment when yuo know python
Simon Hibbs
2007-04-24 03:55:55
I keep reading blogs and articles about Ruby, and reading tutorials, but although the language seems very attractive it just doesn't have the extensive standard library and ecosystem of external projects of Python or Perl. However I have not voted. It's up to you.


BTW, if Perl 6 were out how much do you think that might reduce your yearning for pastures new?

Ewan
2007-04-24 05:29:34
How about Groovy or Scala?
chris
2007-04-24 05:58:13
If you like to "come back to C (and her sisters) and Smalltalk", you gave yourself the answer. Your focus should be on Objective-C.
chris
2007-04-24 06:03:24
appendix: You'll learn Objective-C within some hours, that's not the problem. Objective-C isn't the point, but Cocoa is the challenge.
Rick Innis
2007-04-24 07:31:26
Kudos for knowing LISP and Prolog already :-)


I'll suggest Python. Most of the reasons already suggested are good ones, so I'll just add a couple more: (a) PyObjC allows you to do Cocoa development in Python, and (b) based on some of the sessions in the Leopard Innovations track at WWDC, Leopard incorporates some deeper integration of Python and other scripting languages. (dylanjames' first comment seems to confirm this.) This looks to me like one of the sexiest things about Leopard, but I'm a programming language geek. (If I had the time to learn more of them, I'd be a programming language slut.)

William D. Neumann
2007-04-24 08:18:42
So what am I going after? A new skill set.


In that case I again recommend staying away from Ruby and Python. They aren't going to give you anything you don't have already. Languages like Erlang, OCaml, Scala, Alice, etc. on the other hand may actually take you somewhere new. The Pragmatic Programmers have an upcoming Erlang book that's available now in beta. Scala is a very nifty looking language that is everything Java should have been -- and it's got a promising web framework in development if you ever want to work along those lines. Or if you're really looking to head in a new direction, you may want to take a look at the world of concatenative languages like Joy and Factor.

Rick
2007-04-24 09:32:46
re Python vs Ruby consider this:
http://blog.cbcg.net/articles/2007/04/22/python-up-ruby-down-if-that-runtime-dont-work-then-its-bound-to-drizzown


Also note Python's close integration with Applescript
http://mail.python.org/pipermail/pythonmac-sig/2007-March/018794.html

Steve Majewski
2007-04-24 09:56:10

Thanks Chris, but (mapcar 'beenthere '(done that)). I've lisped and prologed and even (during one dark time) APLed. I'm looking for something more current and important.



So what am I going after? A new skill set. Something to take me to new places I have not yet explored.


If you want to go somewhere new, then you may be better off learning something old.



There is a homogenation and smoothing out of the rough edges in the evolution of programming languages. Older languages tend more often to be a purer representation of one great idea ( Smalltalk: everything is an object ) while more current languages try to incorporate several ideas as well as trying to figure out how to make these old ideas seem less strange and new to today's programmers.


As one example, consider the sequence: SNOBOL, ICON, Python:
SNOBOL is unlike any other programming language.
Icon tried to fit some of the ideas in SNOBOL into a C/Pascal-ish syntax, and made heavy
use of couroutines and generators.
Python, somewhere along the way, grafted something like Icon's generators into the language,
as well as list-comprehensions and some other features -- but none of them are as central
to the language as generators were to Icon.



I'm not saying that the older languages are better -- I prefer multi-paradigm languages for solving problems -- it's a choice of a bigger toolkit. But for a learning experience, there is something about getting deeply into an Everything-is-a-{ Object | S-Expression | value-on-a-stack | ... } world view. ( Musicians somethimes do "restriction exercises" : on guitar, try playing melodies with only one finger on one string, then two fingers, one string; two fingers, two strings... etc. as a way of throwing out old patterns and habits. )


Obviously, something more current is going to be more useful.
I'm going to try to learn Scala next.
But Scala itself looks like an example of this process.
I'm not sure that if I hadn't seen these ideas in earlier incarnations, that I would "get it" just by reading about Scala, where they have been somewhat java-fied and homogenized.


has
2007-04-24 10:15:43
Rick: "Also note Python's close integration with Applescript"


FWIW, appscript (Python's Apple event bridge) has already been ported to Ruby (http://rb-appscript.rubyforge.org), and once I can figure out Ruby's embedding API I'm planning to do a RbOSA component as well. In any case, you only need an OSA component for things like Folder Actions and Mail rules, so while Python's currently slightly ahead here, for most tasks it's a non-issue. HTH

Michael
2007-04-24 12:05:12
learn Chinese, it is the most difficult lang in this world... :)
Bob
2007-04-24 14:00:05
Going in a different direction than the other suggestions, I suggest learning the opcodes of one or more virtual machines, such as JVM or LLVM.


Then you can create your own higher-level languages that compile into virtual-machine code. And really, when you get right down to it, there's nothing like having the skills to create whatever language you want.


I've created many different virtualized languages over the years, for various purposes, in C, Java, proprietary languages, and several assembly languages. It's really amazing what you can do when you can define a language to fit the problem, rather than pick an existing language and fit the problem into it.

Robert Berger
2007-04-24 14:37:06
Ruby, no question (unless you want to go to more esoteric but equally trendy languages like Erlang, Haskell, Io).


Ruby got me programming again. I had been doing my general lite scripting with Python. For a long while, but Ruby came along and got me EXCITED about programming again.


If you liked Smalltalk, you'll love Ruby... (as you have "already been there and done that with both Smalltalk and Lisp)


Its got most of what makes Smalltalk cool, but its got the community and is on the adoption bullet like Python and Perl.

Kevin Buterbaugh
2007-04-24 14:44:39
My 2 cents worth - you already know the only 2 programming languages you need to know: C and Perl, so I'd vote for Spanish if you live anywhere in the Americas. If not, please pick anything besides the highly over-hyped python (anything that can be done in python can be done faster in Perl).


Let the flaming from the python fan boys begin! ;-)


Kevin

will
2007-04-24 14:55:05
perhaps consider tcl? i picked it up recently and it was a breeze to learn. i almost enjoy whipping up user-facing apps now.
Dave
2007-04-24 17:49:41
Clearly, the answer is Mandarin -- because you need to learn how to properly spell it ;-)


You're already sufficiently proficient in all the other choices.

mithras
2007-04-24 21:39:36
Thumbs up for Scala. It's like Ruby or Python in its support for functional features (map/filter/etc., first-class functions, closures, list comprehensions, plus pattern matching and (kind of) algebraic types.


But, it compiles to Java bytecode and runs on the JVM, so it's significantly faster than either Ruby or Python, and you can use the vast universe of Java libraries with it.


I started loving Smalltalky closure & internal iterator code with Ruby, but I've really been frustrated with its speed. It's that slow :) Python is fine, but doesn't really tickle me aesthetically the way Ruby and Scala do.

Simon Hibbs
2007-04-25 00:19:40
I'll just throw C# out there.


Mono is great stuff, and while I found C# a bit heavy going I'm only an occasional programmer. Mono is very widely ported, and has hooks into loads of open source libraries and toolkits, as well as an impressive subset of the orriginal .NET framework.

jeremiah foster
2007-04-25 04:37:02
pugs - because perl 6 is going to be the apocalypse!
AK
2007-04-25 11:20:42
Urdu most definately then you can read Ghalib
matt_n
2007-04-25 14:49:57
I agree with William D. Neumann's assertion that if you want a new skill set then it's time to try something really different like Lisp, Erlang, Scala or something from the ML family like Alice or OCaml. My thinking is: if you want dynamic then try lisp or scheme first, every other dynamic language is watered-down dynamism compared to lisp & friends. I like the compiler to warn me about things so I used OCaml for my most recent project. I've written a variety of things for a variety of organisations over the last 13 years in C, C++, Java, PHP, Javascript, VBScript, bash, Python and Scheme. OCaml is nearly as expressive as lisp and I found it to be a fantastic bugcatcher for the kinds of mistakes I tend to make...it's almost a case of "if it compiles, it runs". Please don't punish yourself with any other language before you give OCaml a try :).
Stephan
2007-04-26 05:36:18
For a human language: Have you considered Chinese?
ajhobbs
2007-04-27 06:15:08
Just a couple of thoughts.


If you want to explore several paradigms, check out Mozart Oz. There's a very nice textbook that explores the various types of programming you can do with Oz.


If you want to grok object oriented programming, Smart Eiffel is a great way to do it. Also covers contract programming.


Gotta agree with the Lisp comments. It's not nearly as dead as you might think, and still very relevant to how you program in other languages.

Scott
2007-04-28 13:08:57
I'd suggest going for something very different from your current things, to give you a different perspective.


Erlang and Haskell would both be good choices.

Andre Bogus
2007-04-29 18:55:01
Lua. To see how small and fast you can go. Plus it is easily embedded into C programs.
Graeme Mathieson
2007-04-30 09:31:05
Ruby's great. It was my 'new language' 3 years ago, and I've been having great fun with it. However, that was 3 years ago. I suspect my next new language, for when I have some free time once again, will be Erlang. Or, if that free time happens soon, Smalltalk, just so I can check out Seaside.


So yeah, for a new language, I'd recommend you check out Erlang.

DaveGee
2007-05-01 13:29:55
Pascal ├╝berall! (never trust a one letter language)


I don't know where I remember that from... back in my HS computer lab no doubt... I remember a guy that hung out there who hated C (purely because it was the language 'everyone' was learning). :lol:

Rob Munn
2007-05-13 19:58:13
Depends on why you want to learn a new language. For purely intellectual pursuit, I would choose something like Haskell. If you interests are more commercial in nature, learn Java or C#, and then tack on either Flex(MXML) + Actionscript or MS Silverlight. Nothing wrong with Python or Ruby, either, but you clearly had those in your head already and seemed to be looking for a reason to choose one of them. Maybe what you are really looking for is a third alternative.
clearance apparel
2007-11-09 05:21:40
Well definitively you should learn Spanish if you don't know the language. It's the most spoken language in the world nowadays.


[Ad link removed -- Ed.]