3 ms·
I'm more worried by the style guide. Just in the screenshot, I notice a lot of oddities and inconsistencies: * Unnecessary parentheses abound * A camelCase
by stephencelis 17y ago
I'm more worried by the style guide. Just in the screenshot, I notice a lot of oddities and inconsistencies:
* Unnecessary parentheses abound
* A camelCase preference over snake_case
* And nocase ("myname")
* Calling methods with "::" and "."
* Curly braces instead of do..end for multiline, unchained blocks.
* Curly braces that don't even begin to line up.
* Strangely erratic whitespace (see parentheses)
Don't get me wrong, I love what you can do with Ruby, but this seems like a confusing thing to throw at your readers.
- petercooper 17y agoIt worries me more that newbies who use this guide will start writing in this very un-Rubyish way and then wonder why their code doesn't get used as much or why they don't succeed at the job interviews.. There's an informal, but popular, style for a reason. This is also why books (should) have technical reviewers. Consider the second example in chapter one that includes: name=gets() .. No true Rubyist codes that way. There's an example a couple of pages on that uses if .. then. No-one really uses then either. This is explained in the text, but why show it if it's confusing and rarely used? And why methods like get_name? That's not typical Ruby style either. It'd just be name. That said, once you get beyond a chapter or two and ignore the quirky stylings, it's not bad and certainly has some value. I know people who had weird music teachers and learned how to play pretty well under them.. but they had to go back and relearn basic breathing and fingering techniques due to the way they were taught.