Should I Learn Python or Ruby next?

lkcl luke.leighton at gmail.com
Tue Jun 22 06:02:15 EDT 2010


On Tue, Jun 22, 2010 at 6:58 PM, Josef Tupag <joseftu... at gmail.com>
wrote:
> Before I really dive in, though, I'm curious to hear what others think about
> the choice between these two languages.

 i think one good illustration is a story i heard from someone who had
learned a hell of a lot of programming languages, but didn't know
python.  he decided one day to try it and, without looking closely at
a manual, literally guessed his way through the syntax:

"how do you do lists?  let's try square brackets.  oh look, that
worked!  ok.. um... how do you do arrays?  let's try curly brackets.
oh look, that worked!  ok, what are they called?  ahh, dictionaries.
how quaint.  ok, how do you do if statements?  ok.... let's try the
woordd if!  ok, that worked - hmmm, how do you terminate them?  let's
tryyy... a colon - great - that worked!  hmmm, what's with this three
dots on the python prompt, now?  ok, let's put in some spaces.  ah
ha!  that worked!"

 when compared to other programming languages, three things stand out
clearly for me:

 1) it's actually readable.  especially when you use colour syntax
highlighting (such as vim) which i thoroughly, thoroughly recommend:
giving yourself those visual cues that keywords are in yellow,
comments are in blue, strings in purple, it increases productivity
*massively* as you scan through reams of text, jumping to the correct
location, finding what you want, based on blocks of colour *first*,
and the characters second.

 2) it's beautiful / tidy.  the use of fixed/identical indentation to
specify a "block" _forces_ the developer to be "tidy".  i've seen some
developers - perl mostly - _actively_ discouraged and hostile to perl
because of this, and to be frank, that's a good thing.

 3) it's a dynamic and a compact language.  i remember seeing that
comparison of python and lisp, which happened to include some java
statements as well.  _six_ lines of java to do what you can do in a
few characters of python - and about two in scheme :)

 so whilst ruby may be dynamic and compact, it's not beautiful,
readable or obvious as to what's going on.  i look at a python
program, and it uses actual... like... y'know... words that make
sense.  i look at a ruby program and i simply cannot say the same, not
even if you put code which is supposed to do exactly the same job.

 l.



More information about the Python-list mailing list