Re: C/C++ guidelines
On Sep 16, 10:50 pm, "Phlip" <phlip...@yahoo.com> wrote:
Jerry Coffin wrote:
A practical goal should be measureable, and should carry a measurable
benefit, that outweights the cost. "Maximum portability" isn't
measureable, carries no measurable benefit, and the cost is extreme.
Thanks that was awesomely correct.
Now notice how my advice - actually become demonstrably
portable as early as your first lines of code - was
essentially the same.
Not really. It's possible to evaluate how much avoiding byte
order dependencies will cost, and decide whether it's worth it
or not, even without having access to a big-endian machine to
test your code. (That's probably a poor example: since avoiding
byte order dependencies is generally a good coding practice,
doing so will probably result in less cost in the long run.)
Crew: Can we have a Sharp Zaurus to run our unit tests on
early and often?
Boss: No!
Crew: Okay; you don't mean obsessively portable, you just
mean generally portable. Gotcha!
I think you missed his point. "Maximum portability" is not
measurable. You cannot, by any means, determine whether a given
program has the quality or not. You can, however, define
certain criteria, such as not depending on the size of a long,
or byte order, or the representation of a float, and measure
whether the program conforms to these requirements or not, and
how much adding such a requirement costs. ("Generally portable"
is no more measureable than "maximum portability".)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34