Re: Coding style - a non-issue

Kai Henningsen (kaih@khms.westfalen.de)
01 Dec 2001 23:45:00 +0200


hpa@zytor.com (H. Peter Anvin) wrote on 30.11.01 in <9u8qtu$u2b$1@cesium.transmeta.com>:

> By author: Jeff Garzik <jgarzik@mandrakesoft.com>

> > "Paul G. Allen" wrote:
> > > IMEO, there is but one source as reference for coding style: A book by
> > > the name of "Code Complete". (Sorry, I can't remember the author and I
> > > no longer have a copy. Maybe my Brother will chime in here and fill in
> > > the blanks since he still has his copy.)
> >
> > Hungarian notation???
> >
> > That was developed by programmers with apparently no skill to
> > see/remember how a variable is defined. IMHO in the Linux community
> > it's widely considered one of the worst coding styles possible.
> >
>
> Indeed. What can you say for a technique which basically promotes
> *reducing* abstraction and information hiding?
>
> There is a reason why the Win64 ABI uses the same "int" and "long" as
> Win32... (both are 32 bits.) They added meaningless abstractions, and
> didn't add abstractions where they needed to...

Well, that doesn't necessarily make the idea itself completely crap just
because the standard implementation is.

Sure, calling a variable "I point to a char! And by the way, I'm named
Fritz" may be a bad idea, but in some situations it may well make sense to
say that a certain variable is a container and another is a lock.

And it seems that sometimes, the kernel does just that. (pagecache_lock,
page_list, just picking two fast examples from 2.4.0 mm)

But lpfilename is, indeed, fucking insane.

MfG Kai
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/