LCDproc development and user support list

Text archives Help


[Lcdproc] comment/reflection upon code style guidelines


Chronological Thread 
  • From: bsdfan at nurfuerspam.de (Markus Dolze)
  • Subject: [Lcdproc] comment/reflection upon code style guidelines
  • Date: Mon, 08 Aug 2011 20:26:02 +0200

Hello

On 08.08.2011 11:38, Liselore Vermeulen wrote:
> L.S.
>
> <replace with polite and clever greeting to all />
>
> I'm having a remark to the "code guidelines"
> the combination of these lines:
> - tabulation to 8 characters

Yes, a tab is 8 characters.

> - lines truncated on 80 chars

You *should* stick to that because this is still the default size of a
console. It is not really required on X where editor and terminal
windows show more on the screen, but using diff on the console is a pain
with more than 80 columns.

Actually if too much wrapping occurs I enforce 100 columns when running
indent. But still 80 is preferred.

> has as consequence - in my opinion/experience -
> - to use "short" variable names , instead of "clearlyDescribing" ones..
> - search for exotic constructions (or even worse: goto's) to reduce level
> of indentation.

Deeply nested levels of indention show that splitting complex tasks into
simpler ones was not done carefully. The deeply nested loops of the
language parser in client and core e.g. could really be easier to
understand.

BTW: I currently prefer forward goto's for clean error handling. They
are not that bad if properly used.

> Since indent is used anyway... do these code guidelines still hold ?

Yes. And my indent is configured to enforce these.

> Friendly serial greetings,
> L.V.
> _______________________________________________
> LCDproc mailing list
> LCDproc at lists.omnipotent.net
> http://lists.omnipotent.net/mailman/listinfo/lcdproc
>

Regards,
Markus





Archive powered by MHonArc 2.6.18.

Top of page