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

Any reasonable editor can be set up so that the tab key will take care of that: ideally, you would also indent with tabs not spaces, and then you could set any tab width (in pixels, or better, points) you wanted and your code would still look right.

The problem comes if you want to left-align some code with a character on a previous line which is not the first non-space character. People often do this for run-on lines, for instance. Then there's no guarantee that spaces or tabs will align you correctly.

The ideal solution to the latter problem is: (i) Don't Do That, Then. (ii) If you want to align code in some carefully prescribed circumstances such as run-on lines, your editor should handle it for you when it displays on the screen (and the alignment hints need never make it into the saved file).



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

Search: