(Edward G. Nilges)
10/23/2009 11:59:00 AM
On Oct 23, 1:57 pm, Gareth Owen <gwo...@gmail.com> wrote:
> spinoza1111<spinoza1...@yahoo.com> writes:
> > It's not a correct piece of software. It divides by zero when x is
> > zero.
>
> Would you describe:
>
> x = *y;
>
> as buggy code?
In terms of modern OO practice, x = *y is buggy code. This is because
both C Sharp and Java define a subset of all possible programs such
that references are always and everywhere managed, not referencing
storage outside of a known error unless, of course, the runtime
virtual machine is itself buggy; the runtime VM machine will be buggy
with small if nonzero probability p while applications code will be
buggy with a much larger probability P>=10*p.
In terms of modern OO practice, C code is buggy code in all cases. The
probability PP of bugginess of any arbitrary snippet of C code is
>=10p where p is the probability of managed C Sharp code.
Furthermore,
return x>0?1:-1;
is a prima facie bug because the closest mathematical function to what
it does is signum, and it gets signum wrong. Neither programmers nor
end users have the right to create new mathematical functions *ex
nihilo*. A competent programmer, when told to "return 1 when x is
greater than zero, and return -1 when x is less than zero", would ask
"what the goddamn hell should I return when x is zero, dorkwad?"
Managers of software used to brag that "every line of code written in
my 'shop' must have a Biznez Case or else because I'm such a studly
dudley practical man, and I don't put up with no monkey business from
a bunch of faggot math majors", or words to that effect.
I would change that. I would say that ideally, every line of code
would have a referent outside of programming, preferably to
mathematics. That's because in an ideal world there would be no
"business", just meeting human needs.