DEV Community

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

 
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.