Muli Ben-Yehuda's journal

July 15, 2003

Code that Sucks #2: PRINTF() does not a portable program make!

Filed under: Uncategorized — Muli Ben-Yehuda @ 6:22 AM

There’s a line of thought amongst programmers who do not understand what portability means that simply wrapping up any system service in a MACRO is enough. printf() becomes PRINTF(), sleep() becomes SLEEP(), etc, etc, ad nauseam. The fallacy here, of course, is that they assume that the name might change, but the interface won’t, which is dead wrong. Name changes are the least of your worries. It’s interface changes that you should be concerned about, and your “portability layer” must present a common, unified interface, not just “the interface of whichever platform this code ran on first”. Furrfu!

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: