3 ms·
Python or Ruby
I seriously love both, but now that I've worked a bit with both of them, I need to focus on one. I love the lisp mentality in ruby (the ? and ! in methods, no need to explicitly write return, block, etc.).. But, as a software engineer, I find python more structured and I find the code to be overall easier to maintain and read. (With Ruby, it's really easy to make those one-clever-liner perl-like).
So, I don't want to start a flame war, but I would like to seriously have good point for one of them. If you could become an expert in one of them, which one would it be?
- RyanMcGreal 17y agoGood news: there's no wrong answer!
- vorg 17y agoInside the Chinese firewall (from Wuhan city, at least), you can't reach the Python download page (http://www.python.org/download/ http://www.python.org/download/), so the "right" answer must be Ruby.
- RyanMcGreal 17y agoRuby: the preferred dynamic language of totalitarians. :)
- samratjp 17y agoErrr... This really is a slippery slope. Personally, python all the way. But, YMMV depending on what you need to get things done. It's perfectly fine to use a combination of both (since you know them both). Yes, sometimes I love python just because it has helped me enjoy reading other's code, something that I just cannot do as easily with Java (C anything or even lisp flavors) without reading comments or looking it up in the library. I guess these days, go with the one with libraries/frameworks that come in handy to you the most. If you love Rails, stick with ruby. Want an event-driven server, a decent web framework, math tools, visualization engine? Python has great frameworks for those and I love it for that. Mind you, I am sure ruby has much more to offer than my limited knowledge, but for me, code readability trumps over other things. As about future direction in terms of community support, I would bet on python just because of the sheer fact that so many of Google's projects are glued together with python and the benevolent dictator works there. He must've done something right to get the Googleplex's attention.
- CyberFonic 17y agoOver time you may end up reading more code than you write. Whether it's your old programs getting a refresh or code written by others, both apps and libraries. Of course, good comments are still most welcome.
- msie 17y agoI was pondering this question the other day while I was reading some server code I had to enhance. I'm a newbie to rails and ruby and I had to figure out how to work with the restful_authentication plugin that was being used by the site. It seems that there isn't any good documentation, tutorials for the plugin and the only way I could learn to use it was through reading the source. I've done a little coding in Python before and I wasn't fearful about reading other people's source code. With Ruby/Rails I have some fear...I hope it will wear off with enough experience.
- cheald 17y agoGoogle picked up doc for restful_auth pretty easily: http://wiki.github.com/technoweenie/restful-authentication/ http://wiki.github.com/technoweenie/restful-authentication/ That said, Ruby can be quite opaque to the newcomer due to the use of method_missing. It can make Ruby code exceptionally powerful, but it does effectively obscure the traditional stack trace, which can make trouble for people that don't understand what's going on. I landed in the Ruby camp (and honestly, I think I prefer it a bit to Python, just personally), but they're both great languages, both have strong communities, and will both serve you well in a number of ways. There are lots of people that are professionally successful in both Python and Ruby. Both have vibrant communities, lots of supporting frameworks and libraries, and lots of success stories. My personal observation is that Python tends to lean towards structure and convention; Ruby tends to lean towards flexibility and malleability. One of Ruby's biggest claims is that it's mindblowingly easy to write your own DSL in Ruby. Things like rake, rspec, cucumber, and the like are exceptionally powerful tools that aren't easily replicated in Python. This can lead to extremely readable, usable code abstractions. The price for this is that the underlying implementation can be somewhat hard to follow until you have a good grasp on Ruby's various tricks. In short, Ruby is far less principled than Python is, but that grants it an agility that Python can't achieve. Depending on what you need, either may be the right tool for the job.