Hacker News new | ask | show | jobs
by zerr 1779 days ago
Making it clear in the code itself that something is platform specific is useful as well. Also, I'd say such stubs and extra files would clutter the project.
1 comments

I tried it your way for years. It's common practice in the industry. I have written and seen plenty of rats' nests of #if and #ifdef snarls so bad one cannot figure out what is being compiled and what isn't without running a just-the-preprocessor pass. It will often #if on the wrong condition, like operating system when it's a CPU dependency.

Rewriting it the way I suggest tends to force a cleanup of all that. You'll like the results.

BTW, if you want to try transitioning to the next level, try getting rid of all the `if` statements, too!