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

This reminds me of the Tabs vs Space discussion, and how once Bill Gates did an AMA on Reddit and his answer was that tabs was better because of consistency.


Consistency with what, all the other code that uses tabs?


In code which uses tabs one logical indentation level is always one tab. You can show tab with different width in you editor, but the source code is consistent.

If spaces are used you never know how many spaces is one logical level. There is no agreement - some people prefer 2 spaces, some 4 and may be somebody uses 8 or 6.

Even worse - I sometimes see when in a single source file some parts use 2 spaces for one logical indent and some - 4 spaces.


They’re faster to use.

They’re consistent between fonts.


> They’re faster to use.

That's not really an argument. Every code editor can be configured to interpret the tab key as desired number of spaces.


Do any code editors also treat a delete of one of these spaces as removing the tab width size? (I've never seen it, but maybe there are ones that do that.) What tends to happen is that yes, the tab enters the N spaces, but if you have to move code around, you can find yourself deleting a lot of spaces.


I'm using VS Code and it does do that. It deletes back to the previous indentation level.

In the case when you move code around you will anyway go for Tab/Shift+Tab in any editor.


You are right, it looks like it tries to do the right thing on indent. Though if you try and use tabs to align anything after an indent it just treats them as spaces.


Not every editor can do this, and this sounds like a “solution” to a manufactured problem.




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

Search: