8 ms·
Is Python or Ruby better as a first language?
- jward 19y agoPython 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 19y agoI 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.
- russ 19y agoRuby is, because Python sucks. Just kidding. But in all seriousness, Ruby is the shizzle.
- AF 19y agoAlso 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 19y agoA nice, sane Assembly language on a processor that does what you tell it, without speculative/out-of-order execution, etc.
- wlievens 19y agoI'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 19y agoYou can even download full-length lectures for SICP: http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/ 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.
- tocomment 19y agoI 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 19y agoBetter than c/c++/java, not as good as scheme/smalltalk. Just my opinion.
- markovich 19y agoOne 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.
- danielha 19y agoA 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.
- SwellJoe 19y agoSorry, 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.
- gyro_robo 19y agoYou 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.