Re: Coding Style

From: Matthias Andree (matthias.andree@stud.uni-dortmund.de)
Date: Sat Jan 20 2001 - 21:00:05 EST


[Don't take this too seriously, the author had asked for flames without
meaning them, so this is the disclaimer ;-)]

On Fri, 19 Jan 2001, Mark I Manning IV wrote:

> found in teh kernel sources bz2. It is done in parody of teh original
> doc and is meant to be laughed at as much as taken seriously.... no
> offense is intended towards the original author :)

> int function(int x)
> {
> body of function // correctly braced and commented :)
> }

So you claim // is a correct C comment? Poor guy :)

> Sane people all over the world have claimed that the K&R inconsistency
> is... well... inconsistent, and they are all right-thinking people
> who know that (a) K&R are _wrong_ and (b) K&R are very wrong.

Hum, K&R were "somewhat involved" in C, but C has in the meanwhile
become bigger than just K&R, so there.

> Linus states that the placement of the first brace at the end of the
> first line keeps your code less vertical and thus saves you some space
> for comments. This commenting style just plane sucks,

Wow, airplanes. Who's bringing trains, ships and cars into Linux then?
(Not the other way round, that'd be easy.)

> I know, I was forced to use it once and I am defiantly brain
> damaged :)

What a confession.

> Chapter 5: Commenting
>
> Comments are good, the more you comment your code the better. These
> comments are not for you, they are for the poor schmuck that has to
> deal with your scratching later. Never underestimate the stupidity
> of this guy, don't leave anything to chance. Never assume that HE
> will understand your logic simply because YOU do.

Write readable code ;-)

> I have never really liked the C language, it seems to me that it has a
> habit of making ANY idiot think he/she can be a coder. C is an easy
> language to learn but to be a good C coder takes years of hard study
> and a TRUE artistic flair for programming. This means that 99% of all
> C code is JUNK code.

Not sure about the percentage, but there are langauages that are more
easily learned, and more easily abused, by people that have no clue what
locking or semaphores are good for that then write data base
applications for multiple simultaneous users.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jan 23 2001 - 21:00:23 EST