From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Eli Carter <eli.carter@inet.com>
Cc: "Davide Libenzi" <davidel@xmailserver.org>,
"Jörn Engel" <joern@wohnheim.fh-wedel.de>,
"Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: Coding standards. (Was: Re: [PATCH] [2.5] Non-blocking write can block)
Date: Mon, 9 Jun 2003 13:49:08 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.53.0306091346150.226@chaos> (raw)
In-Reply-To: <3EE4C4CD.1050809@inet.com>
On Mon, 9 Jun 2003, Eli Carter wrote:
> Davide Libenzi wrote:
> > On Mon, 9 Jun 2003, [iso-8859-1] J?rn Engel wrote:
> >
> >
> >>In the case of the kernel, there is quite a bit of horrible coding
> >>style. But a working device driver for some hardware is always better
> >>that no working device driver for some hardware, and if enforcing the
> >>coding style more results is scaring away some driver writers, the
> >>style clearly loses.
> >
> >
> > There's no such a thing as "horrible coding style", since coding style is
> > strictly personal. Whoever try to convince you that one style is better
> > than another one is simply plain wrong. Every reason they will give you to
> > justify one style can be wiped with other opposite reasons. The only
> > horrible coding style is to not respect coding standards when you work
> > inside a project.
>
> I beg to differ: http://www0.us.ioccc.org/2001/anonymous.c ;)
>
> Eli
Last I looked, we had a good example in the Buslogic SCSI driver.
However, just in case it's been changed, I submit herewith an
example of real code written by a "professional".
//
// This is an example of the kind of 'C' code that is being written
// by so-called experts. It is unreadable, illogical, but it works.
// I wish I was kidding! This is the junk I see being written right
// now by so-called professional programmers!
// Richard B. Johnson rjohnson@analogic.com
//
//
#include<stdio.h>
#define SuccessfulReturnValue 0
typedef int MainReturnType;
typedef int DefaultCounterType;
typedef void NothingWeCareAbout;
typedef const char StringThatIsntGoingToBeModified;
typedef char StringThatCanBeModified;
MainReturnType main(NothingWeCareAbout);
StringThatIsntGoingToBeModified MessageToBeWrittenToTheScreen[]={0x48,0x64,0x6e,0x6f,0x6b,0x25,0x71,0x68,0x7a,0x65,0x6e,0x2a,0x0c};
MainReturnType main(){
StringThatCanBeModified LocalStringBuffer[sizeof(MessageToBeWrittenToTheScreen)];
DefaultCounterType CharacterCounter;
for(CharacterCounter=0;CharacterCounter<sizeof(MessageToBeWrittenToTheScreen);CharacterCounter++)
LocalStringBuffer[CharacterCounter]=MessageToBeWrittenToTheScreen[CharacterCounter]^CharacterCounter;
puts(LocalStringBuffer);
return SuccessfulReturnValue;
}
Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.
next prev parent reply other threads:[~2003-06-09 17:35 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-04 0:58 [PATCH] [2.5] Non-blocking write can block P. Benie
2003-06-04 5:53 ` Christoph Hellwig
2003-06-04 14:35 ` Linus Torvalds
2003-06-04 14:58 ` P. Benie
2003-06-04 16:47 ` Alan Cox
2003-06-04 17:57 ` Linus Torvalds
2003-06-04 19:46 ` P. Benie
2003-06-04 19:56 ` Linus Torvalds
2003-06-04 20:48 ` P. Benie
2003-06-11 0:19 ` Robert White
2003-06-04 20:43 ` Hua Zhong
2003-06-04 23:42 ` Russell King
2003-06-04 23:47 ` Davide Libenzi
2003-06-04 21:29 ` Alan Cox
2003-06-04 17:14 ` Hua Zhong
2003-06-04 17:41 ` Linus Torvalds
2003-06-04 18:44 ` Hua Zhong
2003-06-04 18:47 ` P. Benie
2003-06-04 19:23 ` P. Benie
2003-06-04 19:20 ` Linus Torvalds
2003-06-04 17:53 ` Mike Dresser
2003-06-04 15:21 ` Coding standards. (Was: Re: [PATCH] [2.5] Non-blocking write can block) Timothy Miller
2003-06-07 0:12 ` Greg KH
2003-06-07 0:59 ` Alex Goddard
2003-06-09 16:24 ` Timothy Miller
2003-06-09 16:39 ` Jörn Engel
2003-06-09 17:15 ` Davide Libenzi
2003-06-09 17:33 ` Eli Carter
2003-06-09 17:49 ` Richard B. Johnson [this message]
2003-06-09 18:07 ` Davide Libenzi
2003-06-09 18:22 ` Jörn Engel
2003-06-09 18:55 ` Timothy Miller
2003-06-09 18:58 ` Davide Libenzi
2003-06-09 21:35 ` David Schwartz
2003-06-09 22:55 ` Davide Libenzi
2003-06-09 23:21 ` Nigel Cunningham
2003-06-09 21:54 ` Jörn Engel
2003-06-10 18:17 ` Jesse Pollard
2003-06-10 18:41 ` Davide Libenzi
2003-06-10 18:14 ` Jesse Pollard
2003-06-09 23:50 ` James Stevenson
2003-06-09 18:44 ` Timothy Miller
2003-06-09 22:00 ` Jörn Engel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.53.0306091346150.226@chaos \
--to=root@chaos.analogic.com \
--cc=davidel@xmailserver.org \
--cc=eli.carter@inet.com \
--cc=joern@wohnheim.fh-wedel.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®