Re: C/C++ guidelines
On Sep 16, 3:46 am, "Phlip" <phlip...@yahoo.com> wrote:
Robbie Marshall wrote:
I'm about to embark on a new project and for maximum portability we've
been asked to code it in the common subset of C and C++.
For maximum portability, write unit tests for all your code.
Then you can run the tests on each target platform.
There's a bit of truth there, in that the only really portable
programs are those that have been ported. Still, it won't help
you up front, if the requirements are that the code work on a
machine you don't yet have access to. While nothing can
absolutely guarantee that (not even running the tests when you
finally get access---tests can prove that the code doesn't work,
but never that it does), knowing things that typically cause
portability problems, and avoiding them, can increase your
chances of not having too many problems in a port.
For _real_ portability (not just "tell our boss we are
portable" portability), you could configure a test server on
each target platform. Run the test suite each time you
integrate, automatically on each platform. Configure them to
e-mail all the developers if the tests break on any platform.
Which is fine (and definitely should be done) for the platforms
you have access to today. It doesn't help for those that you
might encounter in the future.
--
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