I find myself using more and more conditional compilation in our C# codebase.
No problem for me, as #if statements are standard in any normal C++ project (just think platform-independent code or MFC/ATL/Win32 SDK) and I’ve been using them since I’ve started my career.
However, my younger coworkers always have an organic reaction when seeing the #if keyword. Whenever I see it, I remember my reaction in my youth. But, as much as I’d like to help them, I cannot. Conditional compilation directives are part of our developer lives and they’ll stay there until mainframes, PC-s, tablets and mobiles will have exactly the same hardware architecture, the same CPU, the same OS … (think OS/360 ported on PC-s with all Windows applications running natively on it). So, probably not in our lifetimes.

Advertisements