Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-13 Thread Stephen Chenney
On Thu, Jul 12, 2012 at 5:31 PM, Maciej Stachowiak m...@apple.com wrote: On Jul 12, 2012, at 1:47 PM, Stephen Chenney schen...@chromium.org wrote: On Thu, Jul 12, 2012 at 3:44 PM, Dirk Pranke dpra...@chromium.org wrote: On Thu, Jul 12, 2012 at 10:53 AM, Ryosuke Niwa rn...@webkit.org

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-13 Thread Ryosuke Niwa
On Fri, Jul 13, 2012 at 5:57 AM, Stephen Chenney schen...@chromium.orgwrote: I don't doubt there are poor comments, both outdated and useless. That's a reviewing failure. You have simply highlighted the fact that any standard for comments requires reviewer attention. Hence cost of maintaining

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-13 Thread Dana Jansens
On Fri, Jul 13, 2012 at 1:56 PM, Ryosuke Niwa rn...@webkit.org wrote: On Fri, Jul 13, 2012 at 5:57 AM, Stephen Chenney schen...@chromium.orgwrote: I don't doubt there are poor comments, both outdated and useless. That's a reviewing failure. You have simply highlighted the fact that any

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-13 Thread Maciej Stachowiak
On Jul 13, 2012, at 5:57 AM, Stephen Chenney schen...@chromium.org wrote: I'd be happy to add a term to the cost function: Cost per year with good comments: t_maintainComments * n_patches + t_understandWithComment * n_engineersNeedingToUnderstand + t_discoverAndFixBadCommend *

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-13 Thread Maciej Stachowiak
On Jul 13, 2012, at 11:03 AM, Dana Jansens dan...@chromium.org wrote: On Fri, Jul 13, 2012 at 1:56 PM, Ryosuke Niwa rn...@webkit.org wrote: On Fri, Jul 13, 2012 at 5:57 AM, Stephen Chenney schen...@chromium.org wrote: I don't doubt there are poor comments, both outdated and useless.

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-13 Thread Ryosuke Niwa
On Fri, Jul 13, 2012 at 11:03 AM, Dana Jansens dan...@chromium.org wrote: On Fri, Jul 13, 2012 at 1:56 PM, Ryosuke Niwa rn...@webkit.org wrote: On Fri, Jul 13, 2012 at 5:57 AM, Stephen Chenney schen...@chromium.orgwrote: I don't doubt there are poor comments, both outdated and useless.

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-13 Thread Maciej Stachowiak
On Jul 13, 2012, at 11:13 AM, Alec Flett alecfl...@chromium.org wrote: And yes while incorrect behavior can be observed through automated testing, automated testing does not catch all incorrect behavior, especially unexpected never-before-seen behavior. Why do you think people write

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-13 Thread Ryosuke Niwa
On Fri, Jul 13, 2012 at 11:13 AM, Alec Flett alecfl...@chromium.org wrote: On Fri, Jul 13, 2012 at 10:56 AM, Ryosuke Niwa rn...@webkit.org wrote: On Fri, Jul 13, 2012 at 5:57 AM, Stephen Chenney schen...@chromium.orgwrote: I don't doubt there are poor comments, both outdated and useless.

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread John Mellor
On Wed, Jul 11, 2012 at 4:53 PM, Ryosuke Niwa rn...@webkit.org wrote: On Jul 11, 2012 8:43 AM, John Mellor joh...@chromium.org wrote: On Wed, Jul 11, 2012 at 4:21 PM, Ryosuke Niwa rn...@webkit.org wrote: What's the point of adding this comment when the URL contains all the information?

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread Maciej Stachowiak
On Jul 12, 2012, at 6:50 AM, John Mellor joh...@chromium.org wrote: To take an arbitrary example, lets say that while iterating through a ListHashSet something causes entries to be deleted. Intuitively it seems this needn't invalidate the iterator, as long as the entry the iterator is

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread Stephen Chenney
On Wed, Jul 11, 2012 at 6:07 PM, Alec Flett alecfl...@chromium.org wrote: I absolutely do not buy that the cost of keeping comments up to date and the cost of out-of-date comments outweighs the benefits - that has NEVER been my experience and if anything the benefits of comments grow as the

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread Ryosuke Niwa
On Thu, Jul 12, 2012 at 10:43 AM, Stephen Chenney schen...@chromium.orgwrote: As several people have shown, it is quite easy to come up with a formula that shows the cost of maintaining comments is much lower than the cost of living without. I object to that conclusion. I've never seen any

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread Dirk Pranke
On Thu, Jul 12, 2012 at 10:53 AM, Ryosuke Niwa rn...@webkit.org wrote: On Thu, Jul 12, 2012 at 10:43 AM, Stephen Chenney schen...@chromium.org wrote: As several people have shown, it is quite easy to come up with a formula that shows the cost of maintaining comments is much lower than the

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread Stephen Chenney
On Thu, Jul 12, 2012 at 3:44 PM, Dirk Pranke dpra...@chromium.org wrote: On Thu, Jul 12, 2012 at 10:53 AM, Ryosuke Niwa rn...@webkit.org wrote: On Thu, Jul 12, 2012 at 10:43 AM, Stephen Chenney schen...@chromium.org wrote: As several people have shown, it is quite easy to come up with

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread Ryosuke Niwa
On Thu, Jul 12, 2012 at 1:47 PM, Stephen Chenney schen...@chromium.orgwrote: On Thu, Jul 12, 2012 at 3:44 PM, Dirk Pranke dpra...@chromium.org wrote: On Thu, Jul 12, 2012 at 10:53 AM, Ryosuke Niwa rn...@webkit.org wrote: On Thu, Jul 12, 2012 at 10:43 AM, Stephen Chenney

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread Ryosuke Niwa
On Thu, Jul 12, 2012 at 2:03 PM, Ryosuke Niwa rn...@webkit.org wrote: On Thu, Jul 12, 2012 at 1:47 PM, Stephen Chenney schen...@chromium.orgwrote: On Thu, Jul 12, 2012 at 3:44 PM, Dirk Pranke dpra...@chromium.orgwrote: On Thu, Jul 12, 2012 at 10:53 AM, Ryosuke Niwa rn...@webkit.org wrote:

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-12 Thread Maciej Stachowiak
On Jul 12, 2012, at 1:47 PM, Stephen Chenney schen...@chromium.org wrote: On Thu, Jul 12, 2012 at 3:44 PM, Dirk Pranke dpra...@chromium.org wrote: On Thu, Jul 12, 2012 at 10:53 AM, Ryosuke Niwa rn...@webkit.org wrote: On Thu, Jul 12, 2012 at 10:43 AM, Stephen Chenney

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread John Mellor
On Fri, Jul 6, 2012 at 11:49 PM, Ryosuke Niwa rn...@webkit.org wrote: On Jul 6, 2012 3:16 PM, Per Bothner per.both...@oracle.com wrote: On 07/06/2012 02:02 PM, Ryosuke Niwa wrote: On Fri, Jul 6, 2012 at 12:54 PM, Per Bothner per.both...@oracle.com wrote: You're deluding yourself if you

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Ryosuke Niwa
On Wed, Jul 11, 2012 at 6:54 AM, John Mellor joh...@chromium.org wrote: On Fri, Jul 6, 2012 at 11:49 PM, Ryosuke Niwa rn...@webkit.org wrote: On Jul 6, 2012 3:16 PM, Per Bothner per.both...@oracle.com wrote: On 07/06/2012 02:02 PM, Ryosuke Niwa wrote: On Fri, Jul 6, 2012 at 12:54 PM, Per

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread John Mellor
On Wed, Jul 11, 2012 at 4:21 PM, Ryosuke Niwa rn...@webkit.org wrote: On Wed, Jul 11, 2012 at 6:54 AM, John Mellor joh...@chromium.org wrote: Even obvious (to some) concepts like InlineBox have subtleties, for example not all inline-level elements have inline boxes. An unambiguous

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Ojan Vafai
On Wed, Jul 11, 2012 at 8:43 AM, John Mellor joh...@chromium.org wrote: On Wed, Jul 11, 2012 at 4:21 PM, Ryosuke Niwa rn...@webkit.org wrote: On Wed, Jul 11, 2012 at 6:54 AM, John Mellor joh...@chromium.org wrote: Even obvious (to some) concepts like InlineBox have subtleties, for example

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Ryosuke Niwa
On Jul 11, 2012 8:43 AM, John Mellor joh...@chromium.org wrote: On Wed, Jul 11, 2012 at 4:21 PM, Ryosuke Niwa rn...@webkit.org wrote: On Wed, Jul 11, 2012 at 6:54 AM, John Mellor joh...@chromium.org wrote: Even obvious (to some) concepts like InlineBox have subtleties, for example not all

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Yaar Schnitman
[(dev time of maintaining comments) + (risk of outdated comments causing bugs X dev time of fixing resulting bugs)] (dev time gained by more contributors each being more knowledgable) No? On Wed, Jul 11, 2012 at 8:53 AM, Ryosuke Niwa rn...@webkit.org wrote: On Jul 11, 2012 8:43 AM, John

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Ryosuke Niwa
On Wed, Jul 11, 2012 at 9:30 AM, Yaar Schnitman y...@chromium.org wrote: [(dev time of maintaining comments) + (risk of outdated comments causing bugs X dev time of fixing resulting bugs)] (dev time gained by more contributors each being more knowledgable) No? How did you reach such a

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Adam Klein
On Wed, Jul 11, 2012 at 9:51 AM, Ryosuke Niwa rn...@webkit.org wrote: On Wed, Jul 11, 2012 at 9:30 AM, Yaar Schnitman y...@chromium.org wrote: [(dev time of maintaining comments) + (risk of outdated comments causing bugs X dev time of fixing resulting bugs)] (dev time gained by more

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Per Bothner
On 07/11/2012 09:30 AM, Yaar Schnitman wrote: [(dev time of maintaining comments) + (risk of outdated comments causing bugs X dev time of fixing resulting bugs)] (dev time gained by more contributors each being more knowledgable) No? Perhaps: [(dev time of maintaining comments) + (risk of

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Ryosuke Niwa
On Wed, Jul 11, 2012 at 10:44 AM, Adam Klein ad...@chromium.org wrote: On Wed, Jul 11, 2012 at 9:51 AM, Ryosuke Niwa rn...@webkit.org wrote: On Wed, Jul 11, 2012 at 9:30 AM, Yaar Schnitman y...@chromium.org wrote: [(dev time of maintaining comments) + (risk of outdated comments causing

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-11 Thread Alec Flett
I'm gonna chime in here, as I am 3 months into working on WebKit and the lack of comments has driven me absolutely crazy. This is a bit of a rant from a self-declared newbie, but I'm trying to be constructive. I've contributed to a handful of open and closed source projects. I am trying to help,

[webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Ryosuke Niwa
As Eric pointed out, this is completely off the topic of the thread now. So moving to a new thread. On Fri, Jul 6, 2012 at 12:54 PM, Per Bothner per.both...@oracle.com wrote: On 07/06/2012 11:41 AM, Ryosuke Niwa wrote: Indeed, we try to avoid adding comments as much as possible since

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Per Bothner
On 07/06/2012 02:02 PM, Ryosuke Niwa wrote: As Eric pointed out, this is completely off the topic of the thread now. So moving to a new thread. [Alas we now have 3 new treads ...] Heavens forbid that someone who actually understands the code should have to update the comments

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Ryosuke Niwa
On Jul 6, 2012 3:16 PM, Per Bothner per.both...@oracle.com wrote: On 07/06/2012 02:02 PM, Ryosuke Niwa wrote: Heavens forbid that someone who actually understands the code should have to update the comments once in a while. Better to keep it inscrutable so newbies spend all

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Benjamin Poulain
On Fri, Jul 6, 2012 at 3:49 PM, Ryosuke Niwa rn...@webkit.org wrote: It DOES. Even today, I find many comments (even FIXMEs) that are out-of-date. Say you add a some comment to a function A because of some odd behavior of another function B, which A calls. Someone awesome later gets rid of the

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Ryosuke Niwa
On Jul 6, 2012 4:09 PM, Benjamin Poulain benja...@webkit.org wrote: On Fri, Jul 6, 2012 at 3:49 PM, Ryosuke Niwa rn...@webkit.org wrote: It DOES. Even today, I find many comments (even FIXMEs) that are out-of-date. Say you add a some comment to a function A because of some odd behavior of

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Per Bothner
On 07/06/2012 03:49 PM, Ryosuke Niwa wrote: If nothing else it's a useful sanity check: If something changes enough that you need to change a comment, that suggests it's a good thing to take the time to think through the implications well enough to write them down. We do that in change logs.

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Ryosuke Niwa
On Fri, Jul 6, 2012 at 4:54 PM, Per Bothner per.both...@oracle.com wrote: On 07/06/2012 03:49 PM, Ryosuke Niwa wrote: If nothing else it's a useful sanity check: If something changes enough that you need to change a comment, that suggests it's a good thing to take the time to think through

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Ryosuke Niwa
On Fri, Jul 6, 2012 at 7:59 PM, Ryosuke Niwa rn...@webkit.org wrote: On Fri, Jul 6, 2012 at 4:54 PM, Per Bothner per.both...@oracle.comwrote: On 07/06/2012 03:49 PM, Ryosuke Niwa wrote: If nothing else it's a useful sanity check: If something changes enough that you need to change a

Re: [webkit-dev] Comments in the code (Was Please include function-level comments in change log entries)

2012-07-06 Thread Per Bothner
On 07/06/2012 08:23 PM, Ryosuke Niwa wrote: Again: Differing cultures Indeed. You just need to get used to it. The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable