4 ms·
Python versus Ruby has always struck me as one of the absurd battles ever. The two languages seem to address a very similar space and have broadly similar featu
by junklight 17y ago
Python versus Ruby has always struck me as one of the absurd battles ever. The two languages seem to address a very similar space and have broadly similar features sets.
Yes there are points of variation but both seem to work really well. People build cool and useful stuff in both. People are productive in both.
As for me - I personally like the syntax of Python better. That could be because I learnt it first - or it could just be something in me. Who knows?
and who cares...
- dschobel 17y agoI think a big reason why it comes up so often is that it's rarely worth the mental real-estate to become proficient in both since they are so similar in design and problem domain. There is significant diminished utility in learning python after knowing ruby or vice versa. You're better of learning something totally different (like haskell!) since you already have a flexible modern scripting language with a great web-framework in your toolkit. However since each language has its trade offs, people have to keep convincing themselves (loudly and publicly, usually) that they made the right decision. So basically, it's contentious and will always be that way for the same reasons that people still debate vim vs emacs after twenty years.
- pmiller2 17y agoThis right here is the exact reason that I, as a fairly experienced and hopefully pretty good Python programmer feel absolutely no desire to learn Ruby. It doesn't offer me anything in terms of making me think differently about programming than Python, and I don't see any particular domain (other than, of course, Rails) where it offers an advantage in libraries or anything. On the other hand, had I stumbled upon Ruby first and then found out about Python, I'm sure I probably wouldn't feel any need to learn Python, either.
- silentbicycle 17y agoI think you're absolutely right, here. Once you know one, you'll probably have much better returns from time spent learning a very different language (such as Erlang, OCaml, or C) than learning the other, barring exceptional circumstances.
- steveklabnik 17y agoI agree with you, the argument is pretty stupid. The reason it gets so heated is that the two languages, while similar from some perspectives, are _wildly_ divergent in philosophy. It really is a Catholic/Protestant battle, as someone pointed out earlier.
- eru 17y ago> It really is a Catholic/Protestant battle, as someone pointed out earlier. And who's who? (Not meant as flamebait. I just want to see where the analogy leads to.)
- steveklabnik 17y agoAs someone who's raised Catholic and prefers Ruby... I don't think that they map together well in any deeper way. Neither language started off as a fork of each other. This particular analogy only runs skin-deep.
- eru 17y agoOK. Thanks!
- dkarl 17y agoAs a "battle" I think it is stupid. Otherwise, I disagree with you. They're very different languages. Python is great for people who are accidental programmers or non-programmer programmers, especially ones who think mathematically and analytically. It's popular among scientists and engineers who need to understand a language pretty completely in a top-down way, but who want to waste as few brain cells as possible on a programming language because their brainpower is primarily applied to other things. Personally, I've always programmed primarily in other languages (C++ being mein liebster Feind) but I've relied a lot on Python (and occasionally Jython) for day-to-day scripting and for delivering code to customers that reorchestrates existing code to do new things. Python has never lit a single creative spark in me, but it has always delivered for me without demanding much in return. Now, that is a statement you will never hear applied to Ruby. I don't know much about Ruby, but the things I hear about it remind me of Perl in some ways. Back in the day, I spent a lot of time learning Perl, promptly forgetting it, and going back to Perlmonks to learn it yet again. Perl comes naturally for impressionists who love to program by instinct, pattern-matching, and trial-and-error. They love it when something new pops into their head and they type it in and it just works, and they aren't immediately sure how or why. Perl is also for dedicated professionals who want a tool that rewards more study and practice with more and more power -- mastery of Perl is a never-ending road with a seemingly never-ending escalation of power and awesomeness. Ruby seems to be a much more easily understood language than Perl, but (from the outside) it seems to share Perl's magical flavor and open-ended approach to mastery. Python is better for people like me who want working, understandable code for the smallest lifetime intellectual investment.
- chromatic 17y ago> Perl is also for dedicated professionals who want a tool that rewards more study and practice with more and more power -- mastery of Perl is a never-ending road with a seemingly never-ending escalation of power and awesomeness. That sounds more like programming (which you can teach yourself in ten years) than any specific language.
- dkarl 17y agoThat's a trite response. Complexity, power, and culture differ between languages. In Perl, people make a game out of doing as much in a single line as possible. Experts do things that are mystifying to a beginner. In Python, an expert would be expected to produce a solution that is comprehensible to a less-expert programmer, spanning however many lines as are necessary. It would be un-Pythonic to write code that a less expert programmer couldn't understand.