[chbot] C Coding Style
Volker Kuhlmann
list0570 at paradise.net.nz
Fri Sep 23 04:22:58 BST 2016
On Fri 23 Sep 2016 11:14:26 NZST +1200, mikael stewart wrote:
> 1. Use of TAB to indent. All decent, modern IDEs all allow scaling of the
> tab character. I like large indents (I have a 16:9 monitor and I'm not
> afraid to use it!), so set TAB to appear as the equivalent of 4 monospaced
> characters. If I pass my code over to someone else, they can easily
> re-scale to suit their eyes without reformatting the content (think tab
> stops in a word processor).
You're stopping short though. To do that properly you'd distinguish
between the tab character spacing and the tab *key* spacing. So you
leave tab characters at 8 because too many editors are dumb. Besides, I
seriously don't want to have to reconfigure editors for each piece of
source code. Then you set the tab key spacing to whatever you like, e.g.
4, and fill up with actual spaces as needed. Works really well. I've
only ever seen one editor though which implements this properly (nedit),
and yes even backspace un-indents correctly. It has other problems. Did
I say editors are dumb?
Volker
--
Volker Kuhlmann
http://volker.top.geek.nz/ Please do not CC list postings to me.
More information about the Chchrobotics
mailing list