TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rails Development No-Nos

9 pointsby heliumabout 16 years ago

5 comments

old-greggabout 16 years ago
<i>indents per line of more than 2 spaces. drives me baddy</i><p>I <i>hate</i> 2-space indentation. It's weird. It makes the code look less readable and every other more or less popular programming language uses 4. I see no reason why Ruby code needs to look like a narrow, dense spaghetti because of this stupid "rule".<p>There is <i>nothing</i> in the language that justifies this awkward feature: Ruby isn't excessively nested and an average line length is short.<p>This language looks <i>beautiful</i> when properly indented with 4 spaces. I've heard from a couple of Pythonista friends that Ruby looked to much Perl-like to them, I suspect <i>some</i> of it can be attributed to this tradition of fucked up indentation.<p>Before reading open source Ruby code I always reformat it properly: just a hotkey in vim.
评论 #606979 未加载
评论 #607049 未加载
ConceptDogabout 16 years ago
Holy crap.. Articles that are almost entirely links to twitter need to burn in hell.
评论 #607508 未加载
umjamesabout 16 years ago
I don't think I agree with no comments in methods and not much comments overall.<p>What if the comments specify why you're taking a certain approach over another or something that was decided by other people? Comments are good for documenting not what the code says, but the reasoning behind that code. This is especially helpful if you haven't looked at it for awhile.
teejabout 16 years ago
&#62; Tabs instead of spaces<p>Every editor on earth supports both. Why the hell do I have to use spaces if the choice has -no effect whatsoever-.
评论 #606955 未加载
评论 #606921 未加载
erlangerabout 16 years ago
Almost all of these "No-No's" apply equally to development on any platform. Adding "Rails" sorta makes it link-bait, since there's very little domain-specific knowledge here:<p><pre><code> * Write tests * Don't write obfuscated code * Consistent indentation, using spaces * Don't mix presentation with logic </code></pre> etc. etc.