0

I have noticed that many famous libraries written in Objective-C (eg. AFNetworking) use the macro guard inside their header files. Im aware that the #import directive, which works exactly like #include, includes each file only once, obviating the need for #include guards. For what reason are still used?

asked Aug 22, 2014 at 12:10

1 Answer 1

2

Because the solution that is already there works 100%, and changing it would require effort and bear a (slight) risk of accidentally introducing defects.

Generally, replacing deprecated constructs with more modern constructs is unpopular with users, and most never do it until you force them by removing the deprecated construct. And from a business perspective they are completely right: modernizing code costs money and yields absolutely no benefit to them, so why do it? The only one profiting from it is the platform vendor, because they can make their compiler simpler, and most application programmers don't care that much about the well-being of their tool vendor.

answered Aug 22, 2014 at 12:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.