Hacker News new | past | comments | ask | show | jobs | submit login
Is Python or Ruby better as a first language?
4 points by pashle on April 21, 2007 | hide | past | favorite | 13 comments



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.


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.


Ruby is, because Python sucks. Just kidding. But in all seriousness, Ruby is the shizzle.


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.


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.


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


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.


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


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.


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.


A strong grasp of concepts and logic with the ability to quickly pick up new languages makes you a good programmer. Learning many different languages will arguably make you a better programmer.

Knowing C++ is not a requirement to, nor has much to do with, being a good programmer.


You will understand the hardware better if you learn C and Assembly. However, except for the syntactic sugar aspects of C++, it degenerates into a boondoggle because of all its weirdness and corner cases. The buggiest software has always been written in C++. It has the most complex language spec and is the hardest to debug because of those obscure corner cases. As programming consists mostly of debugging, extensive use of C++ virtually guarantees needless pain, wasted time, and bugs that won't go away.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: