Home > Articles > Programming > C/C++

  • Print
  • + Share This
From the author of Think Portably

Think Portably

The easiest way to write portable code is not to use C. If portable code is your most important design goal, choose a language that provides a much more abstract model of a computer and shields you from all of the details of the architecture.

If this is impossible, try to think about portability from the start. Identify potentially nonportable code and make sure that it's factored out into separate functions—and ideally separate files—so that you can easily replace it with a target-specific implementation.

  • + Share This
  • 🔖 Save To Your Account