Re: [Q]: Linux and real device drivers

Henning P. Schmiedehausen (hps@tanstaafl.de)
28 Sep 1999 17:10:24 +0200


whampton@staffnet.com (Wade Hampton) writes:

>As for hungarian notation -- I have found that code I write using it
>is easier to maintain as the type of variables is clearly in the
>variable name. Once, when using PLM on an 8031, we had a strange bug
>that we traced to a timer using a char variable, but the valid range
>was something like 300 or so -- hungarian notation makes finding
>such bugs MUCH easier. Just because Microsoft adopted this notation

Sorry, but no.

If you do the following thing:

--- cut ---
main()
{
unsigned char a;
char b;

b = -20;
a=b;

printf("%d\n", a);

}

--- cut ---

and you wonder about the "236" result, then you're either using the
wrong language which does not tell you about such hidden problems [1]
or you have problems understanding your code.

The _MAIN_ problem that I have with hungarian is, that it gives you a
false sense of security. So this is a "pv" (pointer to void). I read
it somewhere and then I assume "pointer to void". But it is still
perfectly legal to write "char pv;" and use this pv. So what do I get
from hungarian? Nothing.

If you need a language which enforces types with the variable names,
why not use Fortran? There is a "VisualFortran" for sure. ;-)

[1] I don't write bug. One man's bug is another man's obfuscation.

Kind regards
Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen --             hps@tanstaafl.de
TANSTAAFL! Consulting - Unix, Internet, Security      

Hutweide 15 Fon.: 09131 / 50654-0 "There ain't no such D-91054 Buckenhof Fax.: 09131 / 50654-20 thing as a free Linux"

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