7 ms·
Python is far more mature, isn't a strange ad-hoc combination of other languages, has a third-party library to do anything and everything (which is probably als
by tdavis 17y ago
Python is far more mature, isn't a strange ad-hoc combination of other languages, has a third-party library to do anything and everything (which is probably also reasonably mature), and doesn't have a community rife with arrogant children.
I'm generalizing to some extent, of course, but these are the things that I and other developers I know associate with Ruby (including many who's startups are built on it). I imagine as the language and community grow and mature they will shed these associations and hopefully create a language worth taking seriously. They haven't done that yet (strictly in my opinion).
- Bjoern 17y ago"..strange ad-hoc combination.." For instance?
- jimmyrr 17y ago...strange ad-hoc combination of other languages. I call bullshit, sir. Ruby is objectively less strange and more consistent than Python. Some has to do with the fact that Python is older - hence has more baggage to carry. A lot of it, though, just has to do with poor/missing design choices. Specifics? - ruby 'block' passing convention is much cleaner and more powerful than python's 'for'/iterators. - python's global functions are stranger and more ad-hoc than Ruby's strict object-orientation. - ruby's mixins > python's multiple inheritance - python underscore (and double underscore) naming conventions to overcome simple language features Don't get me wrong: i love python - but primarily because of the faster execution and larger community - not because of the language itself.
- yangyang 17y agoI have used both, Python more than Ruby. Python's iterators are more usable in many situations than the Ruby block system. I can return an iterator, stick it in a variable, call another function with it that returns another iterator, and so on. Python's classes also seem cleaner and less magical than Ruby's. For example, a method on a class is just an attribute that happens to be a method. Much more intuitive than Ruby in my opinion. I'm also fond of Python's idea that "There should be one-- and preferably only one --obvious way to do it". I agree that Python does have its fair share of strangeness, but that fades away with time (you don't notice it).
- wildjim 17y agoEverything is an object in Ruby, including the blocks. I'm not clear how you can't pass around a block -- or is it the block + iterator metadata you're talking about? I suspect that's just an experience problem, where Python promotes iterators over lambdas so lends itself to a different style of programming; I'm not sure how often you'd want/need to pass a full iterator around in Ruby. Personally I find blocks far more intuitive than Python's iterators and generators, but that is a subjective thing. WRT Magical Classes, I'm not a fan of everything being stored in a dict. It seems grossly under-engineered to expose the underbelly as a basic "dumb" object; at the very least, it should've been a "Class Metadata" object with attached support methods to make it easier (safer?) to inspect or update. And lastly: there is NEVER just one way to do it!! Witness the confusion n00b's feel over the join() method: ",".join([LIST]) where the more intuitive would probably be [LIST].join(",")... but if you MUST have join() in the string module, why not support the latter as a redirect to the former? Seriously: this sort of dogma can make certain kinds of algorithms very messy to code. However, my biggest beef with Python is that I seem to have to write a metric buttload of boilerplate and end up with something very Java-esque... <sigh>
- yangyang 17y agoIt might well be experience, I haven't used ruby a great deal. I wanted to do something similar to izip in Python and couldn't see a way to do that without constructing lists in Ruby. I completely disagree with having to write lots of boilerplate and java-esque code. I've written huge amounts of Python, and seeing Java after that really made me wince. What does Python lack that makes you feel you need boilerplate? I don't think the one-way-to-do-it thing is that dogmatic, really. It does make code nicer when you don't have to be aware of various aliased methods, and there are less ways of making identical code look different.
- cbr 17y agoYou can do ", ".join(x) on any x that you can do "for y in x" on. If join were a method of the list (or sequence, or iterator, ...) then it would need to be defined over and over again.
- tdavis 17y agoQuoting an article on the topic: Having ploughed through several tutorials, I did not find Ruby particularly "elegant", or its syntax particularly obvious. Much of it seemed ad hoc, thrown together, in particular when there were several different ways of doing something, and it seemed to be the philosophy of the language to provide all of them. I did not find its constructs as intuitive and natural as claimed, trying out simple coding examples proved as frustrating when things didn’t do what you’d suppose they’d do... (http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby) I actually gave Ruby a shot, going through the interactive tutorial on http://tryruby.hobix.com http://tryruby.hobix.com. I couldn't do it very long, however, because it was completely ridiculous. In what world does it make sense for hash keys to double as string grep? For instance: my_string['foo'] = 'bar' will replace the first instance of foo in my_string with bar?! WHY?! I can stick an exclamation point on the end of method calls... to signify mutation? WHY?! What twisted logic allows one to rationalize multiplying strings like: "5" * 2 == "55" yet throw an exception for: 2 * "5" It makes absolutely no sense! And why would an integer have a method for converting itself to a string? Or an array? I found so many things in Ruby that made me think, "Okay, superficially that's really convenient and sorta cool... but it makes no sense and it is absolutely counter-intuitive. And I feel dirty using it, even if everybody is doing it." Some people, I assume, find Ruby to be "elegant" for the same reasons I find it to be "an abomination."
- demallien 17y agoWell, I can answer at least a few of those 'WHY?!'s. Firstly starting with my_string['foo'] = 'bar', this is a syntax that is used a lot in Ruby for anytime that you wish to recover a subset of a collection - you can use it with a Dir object for example to recover a subset of directories/files, or in the case of a hash, to recover the object stored at the key. The thing is that you need to think about it as being a subset operator, rather than an index operator. The exclamation point at the end of a method name has no syntactic meaning - it is simply a naming convention used by the standard libraries to indicate when the method mutates the object or not. Same same for method names ending with a question mark, it's just a convention to indicate that the response will be a boolean. As for the whole "5" * 2 vs. 2 * "5", I must admit to not understanding where you're coming from. I don't see how you could expect any other kind of behaviour from an object orientated language. Personally I don't like over-riding arithmetic operators for non-number types, for precisely this reason, but hey, some people like it, so why not? Integers converting to strings? I think every language has that no? I mean there's always something like: sprintf(myStringPtr, "%d", myInteger); or cout << myInteger; etc etc By making this a standard method on all classes (to_s), Ruby makes it really easy to dump a class to a serial format, which is very useful for debugging, as an example. I get the impression that you simply didn't spend enough time with Ruby to come to understand its idioms, in which case, you're not really in a position to effectively criticise the language...
- delano 17y ago... a community rife with arrogant children It's difficult to accept your rational argument when you include stuff like this.
- gaius 17y agoCheck out the Ruby blog scene. It's a wonder they actually write any code in between the bragging about how awesome they are and slagging each other off.
- knowtheory 17y agoSo you're going to judge the entire Ruby community by like... 5% of their bloggers? :P
- wildjim 17y agoTo be fair, "Pythonista's" were renowned for slagging-off most other languages, and in the same breath, claiming how very like LISP their Python is. Hopefully this attitude has died off... Ruby developers (Rubyons?) were renowned for typical Japanese self-effacement when it was becoming popular, which I think was some of the appeal... I guess what goes around comes around...
- jamesbritt 17y agoHey, now we can judge the entire Python community by tdavis's comments. :)
- tdavis 17y agoshrug You certainly could! Though judging any group of people by my comments would certainly do a disservice to that group.
- tdavis 17y agoWhy is that? It can easily be proven. I'm not trying to suggest that everyone who uses Ruby is an arrogant child as I even have friends who certainly don't fit that bill, but when you have an especially abrasive attitude like that within a community, it only takes a minority to sour the majority. And while it certainly isn't a fault of the language, it definitely influences it usage for some people.
- rbanffy 17y ago"a community rife with arrogant children." During FISL, a couple days ago, I witnessed something that really bothered me. It was a presentation comparing Rails with Seaside (which is, by itself, like comparing racing cars with subarines) and the arrogance of the Rails guy dismissing Seaside, Squeak and Smalltalk was very uncomfortable. It seemed the room was too small to fit all the egos inside it. I considered staying until the end and asking a couple questions to demolish the presenter, but I decided it would not be worth it. His belief on the inherent superiority of Ruby and Rails over any other language and framework, past, present and future, bordered on the religious.
- GeoJawDguJin 17y agoRails folks are like that. Even though the rest of the Ruby community is much more reasonable, the weekly Rails debacle has driven a lot of people away from Ruby, including me. If Rails weren't around, it would be much easier to enjoy Ruby without having to use it in isolation. Then again, a whole lot of people wouldn't have gotten into it in the first place. Ruby lived fast and died young. If you don't want to use Python, learn Haskell.
- skawaii 17y ago"Ruby lived fast and died young." How can you say that a language with active development and an active community has "died"? Seems like an odd conclusion to make, IMHO. And it is really easy to enjoy Ruby without Rails. A friend and I have been doing it for a couple years now.
- jamesbritt 17y ago"Ruby lived fast and died young. " Sweet! I am making a living using a zombie, undead, from-beyond-the-grave programming language! I better hook up that USB Ouija board and get coding.
- carbon8 17y agoThat's how I feel about Django at this point. A quick glance at reddit reveals how out of hand it's getting; the answer to every web programming question is "Django!" regardless of whether it's relevant or not. And every popular comment or blog post by Django developers discussing Rails contains a bunch of inaccuracies. At least with Rails there's enough of a push back that even the the annoying minority is better behaved, and Rails development these days is more wycats/merb than anything else. I've always liked Django, but in recent months I've been totally turned off of it, but these days it's tough to develop web apps with python and avoid django.
- jamesbritt 17y ago"Python is far more mature" How so? It's mot like Python is 10 or 20 years older, so how do you determine the "far more" part? And of what value would this difference in maturity be? COBOL is "far more" mature than Python. Is that a big win for COBOL? Once a language reaches some reasonable age and general wide-spread usage, points about maturity seem silly. (On reflection, I suspect you're just trolling.)
- jjs 17y agoIn programming languages, like people, maturity is a function of more than just chronological age.
- pwang 17y agoSpeaking as a commercial Python developer, I can honestly say that there is a tremendous amount of interest in and usage of Python across a wide spectrum of commercial and enterprise applications. This is everything from realtime high-frequency trading to oil exploration to mixing toothpaste to processing Hubble images to manufacturing SATA and PCIe driver chips. The very active, very professional community around the language, combined with the ease of integration with legacy codebases in FORTRAN, C, and C++ makes it very popular in the commercial sector. Consequently, there are numerous institutions and companies that have developers spending time on improving the langauge and its underlying libraries. Guido is a sharp guy and is sensitive to all the places where Python is used, and he takes these into consideration when approving or disallowing language changes. This understanding and the overall process makes the language "mature". On the flip side, I am not aware of any significant impact of Ruby in commercial development that is not web-driven. When we bid on projects and talk to prospective customers, we're typically making a case against Java and C++. I can't recall a single instance where someone seriously asked us about Ruby. (We've had more inquiries about KDB and K, that abomination of a language.) So, just my $.02 as a scientific software developer.