3 ms·
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
by sah 18y ago
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"])
- tptacek 18y agoI'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”
- jrockway 18y agoSomewhat 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.
- jamongkad 18y agoI 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.
- jrockway 18y agoBut 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.
- tptacek 18y agoIt's been written. Look for the articles on how to mimic Ruby "case" statements with Python dicts.
- sah 18y agoBy "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).