3 ms·
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.
by pedrocx486 6y ago
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.
- saagarjha 6y agoConsistency with what, all the other code that uses tabs?
- citrin_ru 6y agoIn 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.
- PunksATawnyFill 6y agoThey’re faster to use. They’re consistent between fonts.
- insulanian 6y ago> 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.
- saagarjha 6y agoNot every editor can do this, and this sounds like a “solution” to a manufactured problem.
- opo 6y agoDo 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.
- insulanian 6y agoI'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.
- opo 6y agoYou 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.