The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: [OT] Coding style nazis



On Fri, 9 Jul 2004 11:01:22 -0000 (GMT), you wrote:

>comments are included in our coding standards
>to, but its pretty much, "you don=92t need comments as you code
should be
>self explanatory"!

LOL - they're kidding right?  Comments are the one thing that should be
compulsory in any standard.  There's no such thing as "self
explanatory"
once you start doing more than var1 =3D var2 statements.
>I get particularly told off for my inline if statements, but I love
them :=
p
>
>
>If (x=3Dy) doSomething(); //neat 1 liner
>
>If (x=3Dy)
>{
>doSomething();
>} //waste of space!

It might save space, but it's hell when it comes to debugging.  Try
stepping through half a dozen of those and trying to figure out what got
assigned and which functions did what.

Anyway, your second version is only 5 characters longer than the first
(ignoring the comments) so it's not really wasting much space.

David P.

--=20
David_Paterson =3D david.paterson@xxxxxxx =A6 david.paterson@vissci.=
com;

Audio programmer          There are three kinds of people in the world -
Visual Science Ltd.         those who can count, and those who can't...



UKHA_D Main Index | UKHA_D Thread Index | UKHA_D Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.