Post

Replies

Boosts

Views

Activity

Reply to What does "#if DEBUG" really mean in Swift?
And frankly, I have no clue what Apple or anyone else has against the C preprocessor. One of the most useful tools in the toolbox. I'm tired of compiler people taking away our best tools because they think we can't use them responsibly. End of rant. Neither Apple nor anyone else has anything against the C preprocessor, in fact they're likely using it themselves. Swift is an entirely different language, not related to C or C++ and most other languages don't have a preprocessor either. Swift never had a preprocessor, no one took anything away. In fact, Apple has been adding more preprocessor-like constructs over the years. That being said, I do wish Apple would add more ways to conditionally compile out code in Swift, particularly how you can do with macros in C/C++, primarily for confidentiality reasons so that things like debugging message strings and other debug data don't end up in the production executable.
May ’23