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

I found it amusing his example of badly formatted code

  one = 1
  fortyTwo = 42
  elite = 1337
is exactly how most modern linters want to format my code.


In IDEs that support refactor-renaming (Emacs probably does?), the column-aligned formatting also has the drawback that it breaks (unless the refactoring also auto-realigns all affected code).

For example,

  one      = 1
  fortyTwo = 42
  elite    = 1337
might become:

  one      = 1
  ultimateAnswer = 42
  leet    = 1337
This made me stop column-aligning in most cases. An exception is array initializers for two-dimensional tables with many columns, where the benefit is important enough.


It also makes git blame a lot less useful in these scenarios.


You can pass git blame -w to ignore whitespace changes, though yes, in general it is annoying.


I wouldn't have made this comment if I knew that. Though I suppose this is still an annoyance for git web interfaces. Thanks for the info!


On GitHub you can add ?w=1 to diff URLs to get the same thing (there's a button for it too?)


I can't find the button. I guess it's a hidden feature




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

Search: