21

C is nice and all but have you ever had to massacre your code with preprocessor instructions to make your code portable?

Comments
  • 1
    yes, one of the reasons why i left it
  • 0
    Yeah sure, and if that sprawls throughout the codebase, you need to refactor it and encapsulate those parts.

    Otherwise, the preprocessor is pretty nice, I'm even abusing it as static website generator.
  • 0
    Yeah these things need to be designed very carefully. You can abstract interaction with system-specific code into a higher level library and only use that library in your main code base, or else you will have #ifdef everywhere
Add Comment