Prev: integer
Next: shared memory question
From: BruceS on 11 Mar 2010 10:35 On Mar 10, 1:29 pm, Anand Hariharan <mailto.anand.hariha...(a)gmail.com> wrote: > On Mar 4, 8:40 am, Richard <rgrd...(a)gmail.com> wrote: > (...) > > > You dont say "if pi is larger than p".You say "if p is larger than > > pi". > > They are not equivalent statements. ;-) No, they certainly aren't (good catch)! If one writes code with the assumption that these are the same, one introduces a bug. So, a better question might be which of the following would you say: "e is larger than pi" "pi is larger than e" ? I know which *I* prefer.
From: Richard Bos on 12 Mar 2010 09:09 BruceS <bruces42(a)hotmail.com> wrote: > On Mar 10, 7:14=A0am, ralt...(a)xs4all.nl (Richard Bos) wrote: > > BruceS <bruce...(a)hotmail.com> wrote: > > > That's a good one; I'll try to remember it. > > > FWIW, the K&R bit was intentional, to make the joke more obvious. =A0Not > > > obvious enough for some, but apparently I either overestimated the > > > volume in the ng, or underestimated the mass. =A0My bad. > > > > No, as should by now be clear, you underestimated the number of people > > who have made such arguments in this newsgroup in all seriousness. I > > didn't understand it was a joke, not because it wasn't jokey enough, but > > because too many people before you have said similar things with no > > jocular intent at all. > > OK, I'm glad we're clear now. It's either sad or laughable (maybe > both) that people do take this so seriously. Definitely both. Hence my misdirected attempt at sarcasm. > So no matter how silly I try to be, someone else acts the same way > being serious. Depends on the subject; this is certainly one for which that is almost true. Almost; even I would smell a rat if someone posted if { /* code... */ } Richard
From: Richard Heathfield on 14 Mar 2010 03:27
Richard Bos wrote: > John Gordon <gordon(a)panix.com> wrote: > >> But if you had typed it this way: >> >> if (7 = x) >> >> The compiler will throw an error. > > So now you come to rely on this to prevent mistypes. Wrong. The compiler cannot prevent mistypes. Not even the editor can prevent mistypes. > And then you write what should be > > if (x == y) > > and you switch the operands for safety, so you write > > if (y = x) Why? > and because you have got completely out of the habit of paying attention > to what you actually write (because, after all, if you had made a typo > the compiler would have thrown an error, right?) That has not been my experience... >, you fail to notice the > mistake even after reading that section of code thirteen times. ....and neither has that. > Meanwhile, your colleague, who does not rely on such broken crutches, > spots it with a single glance at the code. It's not a crutch, it's not broken, and nobody has suggested relying on it. -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ "Usenet is a strange place" - dmr 29 July 1999 Sig line vacant - apply within |