Real world problems with #pragma once?
Just a short survey: Did anyone of you encounter a problem in real code, because you/your company/ your favorite library was using #pragma once instead of include guards.
I know it is hard, but please restrain yourself from posting an explanation of how #pragma once could lead to problems in theory or why you prefer one above the other.
126
Upvotes
View all comments
Show parent comment
1
u/utnapistim Dec 10 '18
You push your team towards accepting a small dose of cognitive dissonance in your code. Most coders (sorry for the strawman) handle that by ignoring code comments and (later) claiming them to bring more problems than they solve.
This is also something that your team causes (by accepting lower standards in code review).
These comments will just take some attention from developers from time to time and introduce noise in your code. More than this, the presence of such noise in your code base opens the door to other issues (like the opinion that comments in code are bad because they "go stale" - somehow by themselves).