[chbot] C Coding Style

Charles Manning cdhmanning at gmail.com
Sun Sep 25 01:49:50 BST 2016


While we're talking of this stuff....

Does anyone have suggestions for an editor that stores differentiles" and
allows you to quickly move between "profiles" for different editing.

For example, I tend to do quite a bit of stuff in the Linux kernel (or
associated code), so I like my editor set up that way (indent = tabs, not
spaces: tab width 8 spaces). But then I will likely also work on someone
else's codebase too where it is indent = 4 spaces, stored as spaces.

First prize would be an editor that supports that with one click/key combo
and does require that you go change all the settings.

Linux of course...

-- Charles


On Sat, Sep 24, 2016 at 3:54 PM, mikael stewart <mikael.stewart at gmail.com>
wrote:

> On Fri, Sep 23, 2016 at 3:22 PM, Volker Kuhlmann
> <list0570 at paradise.net.nz> wrote:
> >
> > 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?
> >
>
> Not sure what you mean by tab character vs tab key. I have a single
> tab character inserted with the press of the key for a single level
> indent, but I have my editor of choice represent this as if it were 4
> mono-spaced characters (or whatever looks right to me).
>
> The automatic replace with space chars is what I dread because
> invariably something goes wrong with either the indenting or
> un-indenting or both. If you say nedit handles this well I'll have to
> give that a go.
>
> Maybe Eclipse which I use more than anything else could handle it too,
> but in all the years I've used it I've not tried. If anything gets out
> of sync with my style convention (copy+pasting from elsewhere, rogue
> space chars etc.), it does have the cure-all CTRL+SHIFT+F (or select
> then CTRL+I) to reformat which seems to work OK.
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20160925/02abd7be/attachment.html>


More information about the Chchrobotics mailing list