Live data from Hacker News

Is Python or Ruby better as a first language?

news.ycombinator.com

1–10 of 14 posts

Re: Is Python or Ruby better as a first language?

#2
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.

Re: Is Python or Ruby better as a first language?

#3
post #2

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…

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.

Re: Is Python or Ruby better as a first language?

#4
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.

Re: Is Python or Ruby better as a first language?

#6
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 :-)

Re: Is Python or Ruby better as a first language?

#7
post #6

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 :-)

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.

Re: Is Python or Ruby better as a first language?

#8
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.

Re: Is Python or Ruby better as a first language?

#9
post #2

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…

Ruby is, because Python sucks. Just kidding. But in all seriousness, Ruby is the shizzle.
Post reply on HN