Lew said:
You said it yourself - it leads to horribly broken code out in
production that people produce new programs without understanding what
they're programming.
The reason that computer programmers command such good wages is that
it is a *skilled* profession. Most people cannot do it, and of those
who can it requires intelligence, study and practice, i.e., it
requires tremendous intellectual effort and capacity.
It is one of the most fundamental and introductory aspects of computer
programming that floating-point "numbers" in a computer are limited-
precision approximations of real numbers.
Mayeul, I'm not sure what point you were actually making. I sincerely
hope you are not arguing in favor of programmers not understanding
what they're doing.
The problem is more fundamental. You can't properly teach floating
point, or a bunch of other necessary programming concepts, without
having students who are proficient at math. We're talking about the kind
of math that underlies all of programming, not particular types of it
that are necessary for specific problem domains.
You can try to assign blame for not being good at math to the
individual, but I blame the public school educational systems we have.
It's not a child's job to know what he or she should know, it's the
schools' job. And they're not doing very well at it. By the time we -
employers, universities and colleges, IT programmes - receive those
prospective programmers, we have a right to expect that they should know
the basics. And more often than not they don't.
Another factor at play, and Arne alluded to it, is that a lot of
programmers - probably the majority - never have to worry about floating
point issues. They'll never get bitten. The biggest source of potential
problems for the general-purpose programmer is likely handling money,
but if there's one pervasive piece of programming CW that even newbies
hear about it's the advice to use integers rather than floating point.
Hence they never have to think about it.
I'm prepared to bet that considerably less than 5 percent of all
professional programmers have thoroughly read _any_ of the handful of
well-known papers on floating point arithmetic.
AHS