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

Only for a tiny, tiny portion of what constitutes a coding style (indentation depth) and only if the original code used tabs for indentation and spaces everywhere else consistently otherwise everything looks like crap when you change the tab width. In my experience most tab-indented projects end up mandating a tab width in their coding style and using anything else leads to chaos. See the Linux kernel for example. Besides if you really value this flexible tab width you can no longer impose a maximum line length since it's tab-dependent.

Beyond that it's quite weird to make tab width configurable but nothing else. What if I prefer to have opening { on the same line as the function prototype? What if I prefer my identifiers to be in CamelCase? What if I prefer not having spaces around arithmetic operators? All that could be done relatively easily if code was stored as an abstract AST and formatted on demand.

Tab indentation is theoretically superior to spaces if used correctly but in practice it's probably not worth the trouble. At least as far as I'm concerned I gave up on tabs a long time ago.



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

Search: