[lug] C programming Q.

D. Stimits stimits at idcomm.com
Thu Apr 18 14:06:15 MDT 2002


rm at fabula.de wrote:
...
> > It's good if you're just learning programming, perhaps.  Mostly, it gets in
> > my way.
> 
> Sorry, but i can't agree. If you aren't a novice then of course you don't introduce
> any prototype missmatches and hence get no warnings ;-) But serious: a prototype
> missmatch _is_ a bug, maybe not one that is still present in the machine instructions,
> but definitely in the samantics of your code.

I have to agree, a prototype mismatch is a bug. Not failing is just a
case of the compiler or language itself helping the programmer along, or
pure luck. There is a purpose for strong typing, if it isn't liked, one
should use another language that has built-in mechanisms intended to
work with mismatches efficiently. C and C++ are not the place for
implicit declarations and loose typing. The bigger the project gets, the
more important this is. Trying to guess what someone else intended 5
years ago on 10 million lines of code is absurdly difficult (comments
are only a small part of the story here, code changes, comments often
don't, or worse yet the comments never existed, or did not exist
concerning the typing in question).

D. Stimits, stimits at idcomm.com



More information about the LUG mailing list