3 ms·
I might have used Ruby but I hear Kernighan & McCarthy turning in their graves whenever I type "end" where a bracket would do the job. Then don't type end, typ
by petercooper 18y ago
I might have used Ruby but I hear Kernighan & McCarthy turning in their graves whenever I type "end" where a bracket would do the job.
Then don't type end, type } instead. Yes, it works.
If you're going to try something and give up before learning syntax, that's great, but trying to speak authoritatively is misleading.
- gord 18y agoWell, I haven't seen a lot of ruby code that uses } instead of end, have you? So using }, although legal, might not be within standard ruby practice. The fact that it _allows_ 'end' would be enough to turn me off :] I guess 'end' wasn't the only reason - while I don't actively dislike Ruby, I just prefer scheme or the lisp family. Part of that is the logical consistency of the lisp languages, part of it is purely personal taste.
- petercooper 18y agoStandard Ruby style is to use { } when the code block is inline or a single liner, and do/end on multi-line blocks. This is only common style though.