[Haskell-cafe] ifdef based on which OS you're on

Doug McIlroy doug at cs.dartmouth.edu
Sun Feb 17 21:20:24 CET 2013


With apologies for prolonging a tangential topic, I'd like to
sharpen anti-ifdef comments that have been posted already.

1. An ifdef for portability is an admission of nonportability.

    What it does is point out a nonportability--a useful crutch
    for maintainers, but a crutch nonetheless.

2. Ifdefs violate program structure.

    All ifdefs appear at top level. Yet, save for those that control
    top-level declarations, they embody conditionals at inner levels
    of structure.

Doug McIlroy



More information about the Haskell-Cafe mailing list