Tom Ritchford
Feb 18, 2024

--

I'm agreeing with this article in general, but I am very, very, very skeptical here, as someone who has written C++ for decades - because ignoring comments is one of the few parts of C++ compilation that's extremely fast.

I've worked in a lot of codebases that were slow to compile, and almost every time it was templating and generic code that made them slow.

Don't get me wrong - C++'s metaprogramming is really good, but it's also potentially very time-consuming to resolve symbols and types.

I just did a quick experiment where I compiled a 3K file, then posted 3MB of comments in, and then compiled it again. The compilation time was identical (within the bounds of error) - and the new file is 99.9% comments.

--

--

Responses (3)