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 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.
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).
It's a common operation. You should see how many people have to code it/get it wrong in topcoder. So it overloads * -- how often are you going to multiply a string?
We have different opinions on what's important in a language. I want something that's as fast to write as prose, so that my mind can focus on other things in the problem domain. This may mean that my code is rather unreadable to people used to coding in specific idioms. But functionality is commented at a higher level, so then what are they doing reading individual statements from my code anyway?
This means that, sometimes, I find myself in opposition to the python community for its goals of readability and regularity, but it's a powerful language chalk full of good ideas and one of the most important tribes on the net, so I still use it.
Because multiplication has a tenuous relationship with Array#join, because Array#join shares none of the "other" mathematical properties of multiplication, because :* is overloaded in other, conflicting ways for other object types, and because the resulting code is needlessly terse and no easier to read as a result of this hack.
It's pretty bad.