DEV Community

loading...

Discussion on: What programming best practice do you disagree with?

Collapse
khalyomede profile image
Khalyomede

Team tab here.

Collapse
michaeldober profile image
Michael Ober

Spaces over tabs for fixed width fonts. Tabs over spaces for proportional fonts. This way the indenting is consistent.

Collapse
ghost profile image
Ghost

I don't see the advantage of tabs, is just a character that you can't differentiate from another just by looking. To me is like having to A that looks the same but are a different unicode. I like to think that in the future, when we solve all big problems, this will be one of the big wars WWX maybe, just after the big WWIX of Vim/Emacs.

Thread Thread
mt3o profile image
mt3o

You can render tabs as any width, while spaces are fixed. This is really useful for formats like yaml (which forces you to use space, btw) where it can get very clumsy with small width of white space

Thread Thread
ghost profile image
Ghost • Edited

I would like that the "r"s of my name looked like flaming swords and the "o"s like eagles, but the main purpose of written language is to visually recognize what is in there and to agree on that. You can't see the difference between a tab and a bunch of spaces, that should be the first priority, everything goes after that, including style; btw, you can use multiple spaces in yaml and in any language I know of, if you are reading code with a single space indentation you should murder the one who wrote it, I think that even a judge would understand. Even 2 spaces are questionable, to me 4 are ideal and 8 like the Linux Kernel guidelines is going too far.

Thread Thread
mt3o profile image
mt3o

With tabs you can render them as you like ;p even as 3 or 7 spaces :)

Thread Thread
kl13nt profile image
Nabil Tharwat

I found this article helpful in understanding the difference: dev.to/alexandersandberg/why-we-sh...

Thread Thread
ghost profile image
Ghost

The argument exposed there "accessibility by default" is flawed, accessibility needs of few are often opposed for the needs of the many. If you have trouble seeing 4 space indents, almos all editors have vertical lines, different colors, font size, space markers, etc. Is a weak argument for tabs. no 2 different characters should look alike, and unless you want to use tabs for all spacing, to me tabs are out. If I see a blank character I know what it is and can even estimate how many. That's why we use text editors and not word processors in the first place or let all just use MS Word or Libreoffice Write to program.