5 ms·
Here’s another argument: If everyone uses tabs for indentation, then you can configure your editor to display that as 2 characters width, while the people who
by Pyxl101 7y ago
Here’s another argument:
If everyone uses tabs for indentation, then you can configure your editor to display that as 2 characters width, while the people who prefer 4 or 8 can do the same. No one needs to argue about how many columns of indentation there will be (1/2/4/8) since it’s specified in text semantically and displayed individually. No one needs to be die-hard N-space-ists since everyone can have their way simultaneously. Even code that wasn’t written by people who prefer your 2-column indent style (if they would otherwise be using spaces) will look that way to you. Everyone wins!
- vanderZwan 7y ago> (1/2/4/8) Sometimes I wonder if I'm the only person in the world with a preference for 3-character width tabs. I also wonder if I can ever bring up this topic in public without being called perverse by other programmers. People get really weirdly religious about this.
- bananicorn 7y agoOh, how come? What language are you using where 3-spaces-wide tabs are more comfortable?
- billforsternz 7y agoAn indentation preference can be largely language independent.
- dkersten 7y agoCan be and probably usually is. However, funnily enough, I have a language-dependent preference: 2 spaces or Lisp-like languages, 4 spaces for all others.
- vanderZwan 7y agoAs the other comment suggested it's language independent. For me, three characters have enough width to be easy to visually distinguish from plain spaces, and the occasional typo, but still easy to keep track of with multiple indentations. I do suspect that Fitt's Law[0] applies to the question of ideal indentation width though. In that case there is a trade-off between trying to minimize the number of characters for less distance, since that makes it easier to "hit the target" with your reading saccade, and having enough distance to make sure indentation has a visually distinct gap from plain spaces. However, the sweet spot of that trade-off is undoubtedly very personal and dependent on many factors. [0] https://en.wikipedia.org/wiki/Fitts's_law https://en.wikipedia.org/wiki/Fitts's_law
- sixbrx 7y agoYou are not alone! Four is too much and two is too little for me visually, three is just right.
- Tarq0n 7y agoThe problem is this only works if everyone is using tabs. As long as there's significant groups of people using spaces you'll need tooling to convert it to your needs anyway. I see more point in making this tooling easier to use and more accessible.
- mstade 7y agoSure, this is the common argument and also the only I typically just ignored in the past simply because I just read it as a debate of preference, and I just care to spend my time with such nonsense – call me an inconsiderate prick if you will, but I picked 2-space indentation and stuck with it. But I never considered the accessibility aspect of it, and inconsiderate as I may be towards the preference of my fully abled colleagues, I definitely don't want to make life harder for my colleagues with accessibility needs. I also believe more accessibility benefits everyone, but it never occurred to me that tabs are more accessible than spaces until I read this thread. Call me a convert – I'm now going to spend time changing my configurations and workflow to work with tabs instead of spaces, wherever possible. Thanks!