http://www.perlmonks.org?node_id=344762


in reply to Re: Re: Re: My coding guidelines
in thread My coding guidelines

In a perfect world, most editors would support the concept of only using tabs for indenting and never using tabs elsewhere (in such a configuration, all lines would match /^\t*(?!\s)[^\t]*$/, no matter what the user typed, perhaps even relaxing the (?!\s) part if they trusted the user to not abuse the privilege).

In such a world, coders could choose this configuration and only ever indent code by an integer number of tabs and then the level of indentation could be adjusted on a whim (by changing the tab size) with reasonable results.

The other requirement is that such coders would need to not attempt to vertically line up parts of lines unless those lines are indented to the same depth. I find such attempts to be very annoying anyway, so I don't consider this a big hurdle. Even Code Complete notes how evil such practices are.

So all we need is wide support for this idea from editors. Unfortunately, I have yet to find even a single editor that supports such a configuration. Otherwise, I'd probably advocate it myself.

As things stand, I find that 4-space indenting is acceptable to nearly everyone and so just standardize on that.

- tye