C++ Features Banned By Google
H. S. Teoh
hsteoh at qfbox.info
Fri Jan 23 23:58:15 UTC 2026
On Fri, Jan 23, 2026 at 02:48:24PM -0800, Walter Bright via Digitalmars-d wrote:
> https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md
>
> This is an interesting document. Of particular note is banning the use
> of exceptions:
>
> https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md#exception_banned
>
> An interesting rationale thread here:
>
> https://news.ycombinator.com/item?id=46738741
Seems mostly historical than anything else. Google probably chose that
route to minimize breakage of legacy code. Would they go the same route
if they were to start from scratch today? I don't know. But this looks
more like a case of inertia of legacy codebases than a decision driven
by technical merit.
> Modules are banned!
>
> https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md#modules-banned
Rationale seems to be inadequate support in Clang and GN (sic - what's
GN?), not that modules themselves are bad. I haven't been keeping up
with C++, though, so I've no idea whether the module system is actually
any good.
In any case, a large existing C++ codebase probably isn't very conducive
to adopting a feature like modules. Knowing how legacy C++ codebases
tend to be, there's probably a ton of hacks based on the old #include
system inherited from C that will break in horrible ways when you try to
slap the new modules system onto an existing codebase / build system.
It will likely result in much churn with no real benefit, so I can see
why they're holding back for the time being.
T
--
Build a man a fire, and he is warm for a night. Set a man on fire, and
he is warm for the rest of his life.
More information about the Digitalmars-d
mailing list