[webkit-dev] Fwd: coding style and comments
Ryosuke Niwa
rniwa at webkit.org
Mon Jan 31 17:23:28 PST 2011
On Mon, Jan 31, 2011 at 4:54 PM, Aaron Boodman <aa at chromium.org> wrote:
> It seems like the one line patch to C just broke A. It had a
> dependency on the behavior of C that was worth documenting. Now you
> have changed C and the behavior of A is probably wrong (or at least
> wasteful).
>
Not necessarily. X' might be better a behavior and Y might no longer be
needed because of that.
If you had the comment, at least a grep of the source would have found the
> dependency and alerted you that it was worth looking at this call site.
I don't think so. How do I know that modifying C would have changed the
behavior of A? This was a very simple example with only one indirection,
namely, B. But in the example I posted earlier (moveParagraph), a function
calls hundreds of thousands of functions and it's virtually impossible even
to enumerate all functions depended by the function. Yet, we must worry
about the side-effects caused by the function in a call site.
And we have tons of functions like this in editing because of the nature of
what it does. So I insist on my point that keeping comments up-to-date is
really hard if not impossible.
- Ryosuke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110131/a7946bc7/attachment.html>
More information about the webkit-dev
mailing list