Hacker News new | past | comments | ask | show | jobs | submit login

Forbid "\t* *\t"?



Ok, but if you get "\t[space][space][space][space]", how do you know this wasn't supposed to be "\t\t"? That is, how do you know trailing spaces are for alignment and not for indentation?


A code formatter knows, so your editor and other tools can also know.

Most editors have code structure parsing of some kind built-in for tabbing already. E.g. pressing the <tab> key indents the current line to match the structure of surrounding code (or cycles between valid indents for something like Haskell or Python). So they know the difference between initial indentation (that people want to be able to configure visually) and alignment.




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

Search: