4 ms·
"Python vs. Ruby (Perl’s Ugly Sister)...This makes the Ruby syntax look like someone emptied all the symbols from the keyboard into a shotgun and shot them into
by carbon8 17y ago
"Python vs. Ruby (Perl’s Ugly Sister)...This makes the Ruby syntax look like someone emptied all the symbols from the keyboard into a shotgun and shot them into your face."
It's amazing watching the python web development community develop, nurture and encourage so much mindless trolling. It has turned reddit completely septic and now this garbage is on the front page here? Sigh.
- deleted 17y ago[deleted]
- tvon 17y ago"It's amazing watching the python web development community develop, nurture and encourage so much mindless trolling." Where are you seeing this? There are a fair number of Django and Python posts on HN and this is the first I've read that I can remember any such trolling.
- carbon8 17y ago"on HN" Indeed, but even here it has been increasing. This made it to #2 within a half hour of posting. Even watching this thread you can see people driving through down modding even mdasen's post. Another recently popular blatant nonsensical anti-rails/pro-django troll that comes to mind was the "Magic Sucks, Django Rocks!" submission: http://news.ycombinator.com/item?id=596833 http://news.ycombinator.com/item?id=596833
- foobar2k 17y agoThe article was meant to address transition points from django to rails not start a flamewar. I was never encouraged by anyone to "troll", this is from my personal experiences. There's no conspiracy theory here.
- olifante 17y agoAs a pythonista who likes ruby, I think your "Perl's ugly sister" comments were a shot in the foot and detracted from the rest of your argument, which concentrates on rails and has little to do with Ruby itself.
- berntb 17y agoFrankly, I'm quite used to see this kind of trolling spam about Perl. You could answer by asking after specific problems with "Perl Best Practices" or what can top e.g. Moose, but language wars (+)? I AM able to grow a beard.... This group of scripting languages seems really similar in functionality and usability today (so if I change environment, I'd probably go functional). The large difference seems to be in the cultures around them... (+) I'm all for editor wars, of course! :-)
- immad 17y agoOh come on, it was funny. You need to lighten up a bit. He gives points on both sides. I do only Ruby and I get what he means.
- petercooper 17y agoWhat does he mean then? I've looked at quite a bit of Python and Ruby source code and Python uses square brackets, periods, mathematical symbols, parentheses, and colons in similar ways. Indeed, a method definition in Ruby uses fewer symbols (no need for the colon on the end, or even the parentheses, although that's against common Ruby style). Python even makes nonsense like using double underscores in method names obligatory. Or how about Python's obligatory parentheses on all method calls? How is Ruby really more "line noise" than Python? Seriously. Sure, Ruby allows you to be more lax than Python and write poor, "line noisy" code, but good Ruby is no more "line noise" than good Python.
- sri 17y agoruby uses < (less than) for inheritance; also regular expressions start & end with / (slash). you have %W, %w for arrays and %q, %Q for string. things like "class << self ..." looks weird to those new to ruby. also stuff like "a ||= ...". and of course pre-pending '@' for instance variables and '@@' for class variables. also when i use regexps in ruby i then say "/re(g)ex/ =~ 'string' && $1". in python that would be multiple statements: "m = re.match('re(g)ex', 'string'); m.group(1)" in python existing syntax (or more familiar syntax) is used to accomplish all the above.
- tptacek 17y agoI never use %w for arrays and I never use %Q for strings. After years of schlepping through Python's regular expression support --- support not dissimilar from the regex support C++ has --- /regexes/ are a gift from god. Also, your Ruby vs. Python regex examples aren't even equivalent.
- petercooper 17y agoSigils on variables are a good point. This is an area where I think Python wins out. Dependence on "self" all over the place is irritating at first but ultimately quite comforting - especially when you wonder whether you're going to screw up your attributes when you use the same name for a local variable in your Ruby method ;-) But on inheritance - you have to put the class name in round brackets in Python, no? That's 2 characters to Ruby's 1. Stuff like a ||= shouldn't be considered Ruby-specific noise as Python also has the same idiom as in a += and a -=, just not with ||. || is arguably noise over "or" but it shouldn't seem like cryptic noise with any sort of experience of C, C++, Java, JavaScript, or almost any other mainstream language. Further, that Ruby code of yours does seem more Perlish than Rubyish, but I suspect this is because Ruby style is gradually shifting away from Perl-like styles to more idiomatic approaches. For example, I'd probably choose 'string'[/re(g)ex/, 1] or if I was trying to be "proper" then something like m = string.match(/re(g)ex/); m[1] (or potentially use Regexp#match, but I far prefer String#match). I see those solutions more typically than those you present - and the latter is quite like your Python example - but.. TMTOWTDI and that's Ruby's greatest asset :)
- olifante 17y agoWhat the hell are you talking about? This is ONE article written by ONE person and suddenly it's the Python community's fault for allowing it to exist? Spare me. This victimization technique should added to the list of Logical Fallacies, if it isn't already there.