Hacker News new | ask | show | jobs
by feelamee 138 days ago
why use modules if PCH on your diagram is not much worse in compile times?
3 comments

Macro hygiene, static initialization ordering, control over symbol export (no more detail namespaces), slightly higher ceiling for compile-time and optimization performance.

If these aren't compelling, there's no real reason.

We live with that for *decades*. For me this is not a daily problem. So yes, this is not compelling, unfortunately.
Having implemented PCH for C and C++, it is an uuugly hack, which is why D has modules instead.
modules are the future and the rules for are well thought out. Ever compiler has their own version of PCH and they all work different in annoying ways.
Modules are the future... and will always be the future.
> Ever compiler has their own version of PCH and they all work different in annoying ways.

I don't care because I use cmake