"Strong typing vs. strong testing"
Pascal J. Bourguignon
pjb at informatimago.com
Thu Sep 30 16:25:56 EDT 2010
Keith Thompson <kst-u at mib.org> writes:
> const double pi = 2.71828182845904523526;
>
> To a human reader, it's obviously either a mistake or deliberate
> obfuscation, but I'm not sure I'd *want* my compiler to warn me
> about it just because I named the object "pi" rather than "e".
> (And if I called it "x", even an intelligent human wouldn't know
> that it's wrong.)
Well, you see, I think it would be perfectly nice from a compiler to
provide a warning if you gave that value to a variable named pi. On the
other hand, I'd expect an error where gcc only gives warning (I usually
compile with -Werror, but that should be the default).
--
__Pascal Bourguignon__ http://www.informatimago.com/
More information about the Python-list
mailing list