Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jan 2001 21:26:20 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        brad.knowles@skynet.be (Brad Knowles)
Cc:        tlambert@primenet.com (Terry Lambert), jcm@FreeBSD-uk.eu.org (j mckitrick), freebsd-chat@FreeBSD.ORG
Subject:   Re: hungarian notation
Message-ID:  <200101192126.OAA16280@usr08.primenet.com>
In-Reply-To: <v04220802b68dd52c746d@[10.0.1.2]> from "Brad Knowles" at Jan 19, 2001 12:30:49 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> >  I think the _ONE_ valid thing to come out of ANSI prototypes
> >  (other than making it the programmers job to do the work that
> >  belongs in the linker; linker writers are lazy... but I digress)
> >  is that you don't need this BS, since the compiler will whine at
> >  you when you have type clashes anyway.
> 
> 	I understand that the compiler should bitch at you if you get 
> this wrong, but IMO it is better if the programmer gets it right to 
> begin with.

If you raise a child with crutches, it will never be able to
run without them.


> 	Hungarian notation is not a sufficient feature to guarantee that 
> this will happen, but it is a stylistic aid that programers can use 
> that may help them more often get it right the first time, and 
> towards that end I believe that it is a good idea.

The problem I have with it is that it obfuscates the meaning
of symbol names.

Consider that I pack and unpack structures to and from wire
format, and I want my symbol names to reflect the contents,
not their current representational geometry, when I do this.

If we are going to do symbol decoration, it actually makes more
sense to discard prototypes entirely, even without the linker
being fixed, and then use GCC C++ style decoration, which would
let us know the return type, number of arguments, and argument
types.

If you want to get technical, a good IDE editor should make
the notation unnecessary, even if you did nothing else.


IMO, conventional clues are problematic in the extreme, since
the first time your student is thrown at a legacy code base
without the notation, it will be as if they have been given
a lobotomy.  The overwhelming number of students find their
first employment in maintenance, since their employer needs
to have them establish trust before they get to move on to
original works.

So you might have an argument for a coding style policy for
a given company (in fact, it makes my employee less useful to
my rivals!), but for teaching, it's a losing proposition.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101192126.OAA16280>