3 ms·
See also the first "good" example at https://github.com/rubocop/ruby-style-guide#no-double-indent https://github.com/rubocop/ruby-style-guide#no-double-indent,
by boffinism 5y ago
See also the first "good" example at https://github.com/rubocop/ruby-style-guide#no-double-indent https://github.com/rubocop/ruby-style-guide#no-double-indent, and the placement of 'from' in it
- eMSF 5y agoNone of your examples pose a fundamental problem for tab-indentation; here's the basics how it should (always) be done, and works, and never breaks anything regardless of the width of the tab character as long as you don't break the gist (which is the hard part, especially with editors which sometimes work against you): def send_mail(source) TABMailer.deliver(to: 'bob@example.com', TAB from: 'us@example.com', TAB subject: 'Important message', TAB body: source.text) end Here, TAB has a width of three but of course the alignment would stay put even if it were wider or narrower.
- jcelerier 5y agoSuch a good argument against tabs. Spaces don't need all these shenanigans.
- throwawayffffas 5y agoIn my book the third example is also bad, only the simple indentation is good.
- brigandish 5y agoI read that and thought to myself "So what? " They're all perfectly readable and consider that an excellent example of bikeshedding. Further up it suggests "Don’t use several empty lines in a row." I put two lines between every method and it makes a language where every block ends with `end` far more easy to grok just from the shape. It seems I won't be using all of their suggestions.
- boffinism 5y agoEr... that's a simple, widely accepted and understood standard, with a broad set of tooling that can detect and auto-correct it. Crucially, it's something that doesn't really matter. Therefore, because it's, in Ruby world, the norm, the great thing is that we can, by default, just accept that norm, never think about it again, and get on with our day. Bikeshedding, on the other hand, is taking a contrarian stance and deliberately arguing over stuff that really doesn't matter so that we spend time and energy arguing over that instead of over the code itself and what it's trying to achieve...
- brigandish 5y ago> Er... that's a simple, widely accepted and understood standard Yes, and pointless, all the examples were readable. > Bikeshedding, on the other hand, is taking a contrarian stance and deliberately arguing over stuff that really doesn't matter Imagine thinking that using tabs is a contrarian stance! I remember when being a rubyist was seen as being able to think for yourself. Times have changed.