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

It's not just about potential bugs though. It's readability, maintainability etc. For me, the original code pasted is horrible in terms of readability. Sure, it's concise, but it's lots of small characters that you could misread etc.


"Sure, it's concise, but it's lots of small characters that you could misread etc."

To each his own, but have you spent much time coding Ruby and encountering this problem?

I ask because it's not a problem I've had or hear from people who have been using the language. It seems to be be an issue expected by people who have not yet spent much time using Ruby (much like concerns over the lack of static typing).

From a distance it may seems as though things would get confusing, but in actual practice this seems not to be the case.

Could be a selection bias, but I would like to hear from people who have truly used Ruby in earnest and stopped because of repeated annoyances.


Can you provide example code written in another language that accomplishes the same (element mapping) which you find easier to read or looks better? I'm not sure Java, PHP, Perl, C# or Python could offer an improvement, besides catering to a preference of keywords ("begin", "end", etc.) over non-letter tokens (parentheses, set braces, etc.). And string interpolation doesn't seem like it would be the source of either more or fewer bugs than string/variable concatenation.

Also bear in mind that, in Ruby, almost all blocks can be delimited with a "do/end" pair rather than set braces.




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

Search: