Re: Coding style - a non-issue

Kai Henningsen
2001-12-02T09:14:26Z

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