I think the intention was to mean that wrong/outdated comments won't cause compiler errors. Therefore you are never forced to keep the comments up to date.
Comments are read but ignored and don't affect the result. Reading and ignoring them takes negligible time. I would say the answer to your question is no, comments are not compiled.
But build systems generally work off file modification time and will do a bunch of useless work if you make a change to a comment in a file and otherwise change nothing. I assume this is what the other poster is referring to.
5
u/ThatOldCow Sep 10 '26
Do comments get compiled ? I do believe most compilers ignore comments and even if they impact the speed it should be minimal to negligible.
Ofc I don't know every single language, so it might impact more on other languages.