4 ms·
Yes, the guard macro pattern works. But it's something programmers manage, so it's a band-aid rather than a solution. If you change a header you need to recomp
by akkartik 14y ago
Yes, the guard macro pattern works. But it's something programmers manage, so it's a band-aid rather than a solution.
If you change a header you need to recompile all files that include it, even if the include was conditional. Now your build system starts to look inside files rather than just check timestamps. Similar tool bloat happens over and over again in large codebases.
I'm not convinced Go has the right solution. But it's disingenuous to claim that it's competing with the C preprocessor. It's leagues better.
You should enumerate all the information in the paper you consider to be misleading.
- jeremyjh 14y agoCan you name a language developed since the 80s that hasn't also solved this problem?
- akkartik 14y agoFrom the article: "It's worth mentioning that this general approach to dependency management is not original; the ideas go back to the 1970s and flow through languages like Modula-2 and Ada. In the C family Java has elements of this approach."
- enneff 14y agoPython? Ruby? JavaScript? There are many more, but I name these three as they are among most popular.
- jfb 14y agoHow has Javascript even addressed this problem?
- signa11 14y agoi am kind of surprised that no one has brought up "#pragma once" or even external-include-guards (as proposed by jon-lakos). both seem to drastically cut down build times...