There's a standard definition of "comment-free" in challenges
Typically, if a challenge asks for "comment-free" code, it defines that as code in which deleting any single character would cause the program to change its input/output behaviour (sometimes with exceptions for whitespace, particularly in polyglot challenges, because languages often vary with respect to how much whitespace is required). This has the advantage of being objective, fitting the intuitive understanding of a "comment" fairly well, and being of a familiar form for PPCG (it's basically the exact opposite of radiation-hardening). It also fits the intuition that "a correctly golfed program contains no comments" (if you're aiming for code-golf and not restricted-source, then all winning programs must be comment-free by this definition, as otherwise you could trivially save a byte).
Despite being the best definition I'm currently aware of, it also has a few known issues:
- Probably the smallest issue: in languages with multiple-character comment markers (like C's
/*…*/), it allows the code to contain empty comments without issue (because deleting any single character from /**/ causes it to not be a comment, and have some impact on the code). - There are some languages, like Burlesque and A Pear Tree, in which any deletion from the source is likely to radically change the way it parses (because the language thinks in terms of blocks of characters rather than single characters, and any deletion must be from some such block). These languages can often trivialise this sort of challenge.
- There are universal techniques for creating arbitrarily long "comment-free" no-ops in most programming languages. (Typically, this requires creating a long literal, normally but not always a string literal, and then doing some sort of checksum operation on it to ensure that it hasn't been changed.) This means that this definition does not really help with attempts to remove the many loopholes from code-bowling.