2 ms·
"I cannot get foo.[3] to work" Hey, neither can I. Quite possibly because foo.[3] actually doesn't work, it's foo[3] that works and I made a typo. Sorry about
by raganwald 19y ago
"I cannot get foo.[3] to work"
Hey, neither can I. Quite possibly because foo.[3] actually doesn't work, it's foo[3] that works and I made a typo.
Sorry about that, and especially too bad considering how your first reaction was to consider the possibility that your version of Ruby was at fault instead of the possibility that I made a careless error. I appreciate the implied vote of confidence, but I'm aghast at the consequences.
I appreciate your taking the time to share your reaction. I'm mulling over exactly what I prefer about the point-free syntax, and the prod to think thinks over may help me understand my own views in more depth.
- mechanical_fish 19y agoSo, part of me is tempted to use this as an example of the reason why languages benefit from a certain amount of redundancy and consistency. :) The other part of me is quite embarrassed, because I thought I had tried foo[3] and failed. I guess that's why everyone in the Ruby community prefers automated testing! Of course, if I thought that applying an array reference to a Proc made any sort of intuitive sense, I might have tried it more carefully. :) I still wish that I could just say foo(x). Anyway, I'm glad you appreciated my report from the field. And of course you prefer the point-free syntax -- you know Haskell, you know Lisp, you seem to know a certain amount of mathematics. It all makes perfect sense to you, just as I can only dimly remember the time when vector calculus didn't make perfect sense to me. But I shouldn't indulge my love for German by randomly German syntax into my English prose inserting. Unless I have a very good reason: perhaps I want to borrow the uniquely compact German word shadenfreude, or perhaps essential it is the alien character of Yoda to establish. When you break the rules in Ruby code that you intend to show to someone else (and is there really any other kind of code?) you need to convince the reader that you had a very good reason, because you're making him or her work harder to understand you. Keep playing with the syntax for a while. You may find that it's so elegant that it is worth defending against the inevitable skeptics. And, if not, at least golf is a very pleasant way to pass the time!
- raganwald 19y ago"golf is a very pleasant way to pass the time!" Golf is a good walk spoiled => Golf is good code spoiled.