
Is Python or Ruby better as a first language? - pashle

======
jward
Python is, because Ruby sucks.

In all honesty, both are great. People who use either love their language and
will pretty much tell you to start with the one they use. Both are free and
have good tutorials online with large user communities you can go to for help.
Spend a few hours with both and see which one 'feels' best to you and go with
it.

I'm a Python guy so I'd recommend Python over Ruby. I just find it easier to
read and that makes it easier to understand.

~~~
nostrademons
I concur, and I'd add that I think Python is better as a _first_ language. The
basic language features in Python are all fairly intuitive, and the syntax is
about as English-like as you're likely to get. You don't run into weird stuff
like all the __methods__ until you do more advanced programming, at which
point you'll be ready for them.

Ruby has a bunch of added concepts like sigils, blocks, weird operators,
redefinable methods, metaprogramming, etc. These aren't terribly hard to
understand if you've been programming a while, but they can be a little
overwhelming for a newbie. I'd say Ruby is more suited for a Lisp or Smalltalk
refugee that wants something a little more practical, not for a complete
newcomer.

In terms of actual programming power, they're both good. Ruby is a little bit
more flexible and provides a few more shortcuts for common operators, but
anything you can do in Ruby can be done without too much trouble in Python.

------
wlievens
I'm all for Scheme as first language. When combined with the SICP book for an
introductory CS course, it allows you to explore pretty much any concievable
paradigm in a single solid framework.

Sounds like a sales wrap, but it's really how I feel about it. And it's the
MIT thing to do :-)

~~~
Goladus
You can even download full-length lectures for SICP:

<http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/>

Anyway, I'd say the differences between Python and Ruby as a first language
are too minor to matter. By the time differences in available libraries should
matter, you should be able to decide for yourself which language to use.

------
AF
Also keep in mind that Python has much better (quantity and quality)
libraries.

Compare, for example, SQLAlchemy to ActiveRecord. Not even close. Heck, you
could even compare Django's ORM or SQLObject to AR and they too tend to be
more impressive.

In my mind a beginning programmer benefits as much if not more from quality
libraries than a veteran programmer.

------
gyro_robo
A nice, sane Assembly language on a processor that does what you tell it,
without speculative/out-of-order execution, etc.

------
tocomment
I find the syntax of Python very logical and intuitive (except for decorators,
those seem magical). So that's why I prefer Python. And like others have said
it's more mature and practical.

Perhaps start with Python but plan to take on another language in 2-5 years,
when Ruby is more mature, or web hosting companies start supporting Scheme, or
Haskell, etc.

------
papersmith
Better than c/c++/java, not as good as scheme/smalltalk. Just my opinion.

------
markovich
One thing you should keep in mind is that you _have_ to move on to C++ to
become a good programmer. Start with any of the languages, then do C++ for a
couple of years. Otherwise, you will never be able to work in a low level
language, since you will be pampered by all the simplicity of these languages.

~~~
SwellJoe
Sorry, this is just wrong.

There's so much in C++ that is specific to C++ that it doesn't even begin to
make sense. If you want someone to learn OO, send them to Ruby or Smalltalk.
If you want them to learn about performance and deep machine magic (pointers
and such), send them to C. In either case, they can learn what they need to
know without getting bogged down in a really obtuse pile of bolted-on features
and syntax. It's not a bad systems language, but it's not a learning language
and never will be.

And the whole "you'll never be able to blah blah" crap is just a hugely stupid
idea. Don't think of your learning process as preparing to do something. Pick
a project and start working on it--Open Source gives you access to millions of
lines of code. There is no better way to learn to program than through working
on programs. Be useful as soon as you possibly can, and you'll find that
people are willing and eager to help you learn, because they see that the
better you become the more useful you are to their project.

