3 ms·
"If you’re looking for a flame post - this is not one of them. I love both languages and I’ll simply compare some of their features and possible uses." This wa
by edanm 16y ago
"If you’re looking for a flame post - this is not one of them. I love both languages and I’ll simply compare some of their features and possible uses."
This was an interesting post, and I'm sure the op didn't mean any of it as a "flame". Problem is, on a lot of the comparisons, the op just said "I won't get into this, but I prefer Python" (or Ruby, depending on the feature). Those kinds of statements don't really advance anyone's knowledge, but are sure to get some people annoyed.
As someone who uses Python but hasn't learned Ruby, this article got me to the same conclusion I alway get - while Ruby has a few very interesting differences and clever tricks I'd love to learn, it's so similar to Python that I'm better off learning a completely different language.
One thing I think is tiny, but incredibly helpful in Ruby, and I don't understand why more languages don't have it - the ability to add "?" and "!" to operators. That's an actually useful convention.
- tesseract 16y ago> One thing I think is tiny, but incredibly helpful in Ruby, and I don't understand why more languages don't have it - the ability to add "?" and "!" to operators. That's an actually useful convention. My primary languages are Ruby and C. After working in Ruby for a while and then switching back to C I often find myself naming predicates with a trailing _q. I don't have an equivalent for !, though.
- edanm 16y agoIn C/C++, I was usually in the habit of adding "Is" in front of predicates. "something.IsDone()", "something.IsOver()", etc.
- wybo 16y agoWhile the '!' addition to methods is an useful convention, having both collect, and collect! methods, and for example only a delete method for arrays (which does change the array it is called on), and similar inconsistencies in libraries, can occasionally lead to unnecessary API-lookups/bugs. (I have been using Ruby (in a FOSS/academic setting) for a couple of years now (and I know Python too, though still prefer Ruby over it))
- xiaoma 16y agoI never even really questioned the delete method. By its very name it was clear to me that "delete" would be destructive.
- dheerosaur 16y agoI once asked on #python why "?" is not allowed in names of identifiers. People responded by saying that Python prefered cleaner names. So, it was just an aesthetic preference. More here: http://coding.derkeiler.com/Archive/Python/comp.lang.python/2004-10/0990.html http://coding.derkeiler.com/Archive/Python/comp.lang.python/...