Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree with you that many of these shortcuts are obnoxiously read-only, but that was probably the worst example you could have picked. That notation is nicer than Python's standard ", ".join(["foo", "bar", "baz"])


I'm not picking on Ruby, I'm picking on the article. The worst example? No, that'd be:

does = is = { true => 'Yes', false => 'No' }

does[10 == 50] => “No”


Somewhat like this way (in Perl) of finding the larger of two numbers:

  [$a => $b]->[$a <= $b]
I tend to just say max($a, $b) though.


I love Ruby for it's expressiveness even more so than Python. But the author's code examples tend to make me hesitate for the reasons that bad Perl code makes my eyes fall out.


But the author's code examples tend to make me hesitate for the reasons that bad Perl code makes my eyes fall out.

It's nice to read the article for that reason. Hopefully people will realize that you can write horrifyingly bad code in any language. I'm looking forward to the Python edition ;)

Maybe we can start approaching language design rationally when people start realizing that all languages suck big time. Even Ruby. Even Lisp.


It's been written. Look for the articles on how to mimic Ruby "case" statements with Python dicts.


By "worst example", I meant that I thought it was a poor example of your point, because the notation you quoted is okay. A lot of the other ones were worse code (and better examples of your point).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: