[Expat-discuss] Coding style in Expat
Karl Waclawek
karl@waclawek.net
Sat Jun 15 16:29:01 2002
> There have been some emails on the expat-checkins list regarding the
> coding style in Expat. I've not actually received them all since
> SourceForge's mail systems seem severely overloaded and has not been
> delivering email in a timely manner (I've seen as much as a 4 day
> delay).
Wow! Actually, a lot of things seem overloaded in SourceForge recently.
> Anyway, here are my comments on the coding style.
>
> The Expat code base exhibits signs of coding style inconsistency,
> possibly because additional people have taken over maintaining it
> since James Clark wrote the original code, and don't feel comfortable
> with his style.
I try to follow, but may have made errors!
> The original style uses 2-space indentation levels with leading hard
> tabs which represent 8 columns each. The hard tabs definately cause
> code to look funny for people whose editors are configured to show
> tabs as 4 columns, causing a weird "reverse indentation" appearance in
> some cases.
In my case tabs show as 2 columns.
Thanks for pointing it out. I thought that was intentional.
I found the code pretty hard to read sometimes...
Why didn't I look further into it? <damn>.
> Solving the reverse indentation problem can be accomplished by
> converting the code style to use only spaces and no tabs; this should
> be done just before the 1.95.4 release.
You have my blessing. :-)
> The two-space indentation can be difficult to read as well, but it's
> less clear that a change is actually required.
>
> My personal preference would be to use a 4 space indent, but the Expat
> code is already rife with long lines and deep nesting. It's not clear
> that changing the 2 space indents is worth the pain. (See the .c
> files in the tests/ directory for examples of my preferred C style.)
Yes, I cam live with two spaces - actually, I find four spaces
too much. Anyway, after reading the code with reverse indentation,
nothing can scare me anymore <g>
Karl