“#ifdef Considered Harmful”

This is an old (1992) paper on writing cross-platform C programs, but it’s useful nonetheless. A lot of the problems highlighted in it have all but vanished over the intervening years, but the general ideas are still valid, even on Windows machines. (Have you ever tried writing a non-trivial Windows application, using the raw Win32 API, that’s portable between Win9x and NT-based systems? “Fun” doesn’t begin to describe it.) The solutions that they suggest are good ones, though the Boost libraries and projects like wxWidgets go a long way toward making them unnecessary.

One Comment

  1. This is a famous article. Henry Spencer was a bit of a net.celebrity, being the author of the premier Usenet News software in the days before spam and AOL ruined it, and the web bypassed it.

Comments are closed.