[webkit-dev] Class-level comments in the source code

Filip Pizlo fpizlo at apple.com
Fri Jul 6 15:03:35 PDT 2012

It is indeed a problem of incentives.

Nobody has the incentive to maintain a class comment when making changes, since comments are not checked by the compiler.

Therefore, it's much better to not write comments, and instead find other ways of making the code legible.


On Jul 6, 2012, at 3:02 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:

> On Jul 6, 2012 2:36 PM, "Per Bothner" <per.bothner at oracle.com> wrote:
> >
> > On 07/06/2012 02:18 PM, Ryosuke Niwa wrote:
> >> I've found that our culture of not adding comments have given me a
> >> pressure to think really hard to come up with better class names rather
> >> than going with vague names with explanatory comments. In some cases, it
> >> made me realize that the particular object relationships I had in my
> >> mind was not a good design and made me come up with a new design that
> >> involved easier-to-understand classes.
> >
> >
> > Pressure to come up with good names isn't incompatible with comments ...
> It's a problem of incentives. In the world where we write per-class comments for every class, there might be less incentive or simply time for coming up with better names because we can always clarify the intent in comments.
> - Ryosuke
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120706/2232866f/attachment.html>

More information about the webkit-dev mailing list