I don't feel strongly about FIXME or TODO(n) either way, but if we switch, I think it'd probably be better to just leave the legacy FIXMEs rather than trying to convert them.
Daniel
On Thu, Mar 12, 2015, 11:47 TAMURA, Kent <tk...@chromium.org> wrote:
I propose a coding style change so that we use TODO(name) instead of FIXME.
I think we should allow TODO(name), but must we ban all new uses of FIXME? In the ongoing IDL spec sync, I'm adding FIXMEs wherever something diverges from the spec. Even though "A TODO is not a commitment that the person referenced will fix the problem," I think it would look rather odd if my name is sprinkled all over our IDL files. It's not needed to find out how to fix the problem, since there's a link to the spec IDL in the same file.If we don't want new FIXMEs, would "Note:" be an acceptable replacement in this case?
Is TODO(bug#) acceptable? This has advantages over TODO(name) - the bug provides additional context, is easily reassigned, and makes it clear if the TODO is obsolete.
Is TODO(bug#) acceptable? This has advantages over TODO(name) - the bug provides additional context, is easily reassigned, and makes it clear if the TODO is obsolete.
A pretty typical comment that I have added recently is "FIXME: documentURI should not be nullable" right above the documentURI attribute in Document.idl. Not far above is a link to https://dom.spec.whatwg.org/#interface-document which confirms this. Would including the name of the person who annotated the differences really be useful here? In what cases are bare TODOs acceptable in Chromium?
On a separate note, I'm a sucker for consistency, and leaving all existing FIXMEs alone would make the Blink code increasingly inconsistent locally. For a long time new contributors would have to learn which form is preferred. I would like to mass-convert them to TODO, or even better use a script to include the user name of at least FIXMEs added since Blink forked from WebKit.
On Fri, Mar 13, 2015 at 10:36 AM, Philip Jägenstedt <phi...@opera.com> wrote:A pretty typical comment that I have added recently is "FIXME: documentURI should not be nullable" right above the documentURI attribute in Document.idl. Not far above is a link to https://dom.spec.whatwg.org/#interface-document which confirms this. Would including the name of the person who annotated the differences really be useful here? In what cases are bare TODOs acceptable in Chromium?Why is including your name harmful?What happens if later someone adds 100 lines of code between these two places? Or removes the spec link? Or the code gets refactored and moved to a different place? Just because there's nearby context now doesn't mean there always will be.So yes, I think your name should be here.
On a separate note, I'm a sucker for consistency, and leaving all existing FIXMEs alone would make the Blink code increasingly inconsistent locally. For a long time new contributors would have to learn which form is preferred. I would like to mass-convert them to TODO, or even better use a script to include the user name of at least FIXMEs added since Blink forked from WebKit.There are many places where our code is inconsistent, some of them due to style changes over time. The authority is the style guide: today the Blink style guide explicitly says to use FIXME. If that is changed, I don't think existing differing practice in the codebase is a problem, especially on this issue, where I just don't see a lot of new contributors wanting to write such comments, seeing lots of FIXMEs, and commenting them
On Sat, Mar 14, 2015 at 3:38 AM, Peter Kasting <pkas...@google.com> wrote:On Fri, Mar 13, 2015 at 10:36 AM, Philip Jägenstedt <phi...@opera.com> wrote:A pretty typical comment that I have added recently is "FIXME: documentURI should not be nullable" right above the documentURI attribute in Document.idl. Not far above is a link to https://dom.spec.whatwg.org/#interface-document which confirms this. Would including the name of the person who annotated the differences really be useful here? In what cases are bare TODOs acceptable in Chromium?Why is including your name harmful?What happens if later someone adds 100 lines of code between these two places? Or removes the spec link? Or the code gets refactored and moved to a different place? Just because there's nearby context now doesn't mean there always will be.So yes, I think your name should be here.For IDL files, the spec is the authority on what they should say. The spec's URL and content can change to make any part of our IDL files wrong, but then you need to look at the spec's revision history to understand why. I will grant that this isn't always trivial and that if there's a TODO(philipj) nearby I could be asked to help figure out what has happened.After going through only 10% of our IDL files I've added 142 FIXMEs, about 1 every 16 lines. It's the eventual number of TODO(philipj) that makes me a bit uncomfortable, but maybe I could get used to it. Or maybe FIXME isn't the best way to annotate differences with the spec.
I'm sympathetic to an argument for consistency, however.On a separate note, I'm a sucker for consistency, and leaving all existing FIXMEs alone would make the Blink code increasingly inconsistent locally. For a long time new contributors would have to learn which form is preferred. I would like to mass-convert them to TODO, or even better use a script to include the user name of at least FIXMEs added since Blink forked from WebKit.There are many places where our code is inconsistent, some of them due to style changes over time. The authority is the style guide: today the Blink style guide explicitly says to use FIXME. If that is changed, I don't think existing differing practice in the codebase is a problem, especially on this issue, where I just don't see a lot of new contributors wanting to write such comments, seeing lots of FIXMEs, and commenting themWhy wouldn't a new contributor eventually want to write a FIXME and copy local style? Even if a presubmit hook can inform them of the problem, that same presubmit hook will trigger on refactoring for years to come. This kind of organic transition is IMHO much inferior to just writing a script and making everything consistent at the time you change the style guide. Some style changes are too tricky to do that, but this one isn't.Philip
On Sun, Mar 15, 2015 at 8:32 PM, Philip Jägenstedt <phi...@opera.com> wrote:On Sat, Mar 14, 2015 at 3:38 AM, Peter Kasting <pkas...@google.com> wrote:On Fri, Mar 13, 2015 at 10:36 AM, Philip Jägenstedt <phi...@opera.com> wrote:A pretty typical comment that I have added recently is "FIXME: documentURI should not be nullable" right above the documentURI attribute in Document.idl. Not far above is a link to https://dom.spec.whatwg.org/#interface-document which confirms this. Would including the name of the person who annotated the differences really be useful here? In what cases are bare TODOs acceptable in Chromium?Why is including your name harmful?What happens if later someone adds 100 lines of code between these two places? Or removes the spec link? Or the code gets refactored and moved to a different place? Just because there's nearby context now doesn't mean there always will be.So yes, I think your name should be here.For IDL files, the spec is the authority on what they should say. The spec's URL and content can change to make any part of our IDL files wrong, but then you need to look at the spec's revision history to understand why. I will grant that this isn't always trivial and that if there's a TODO(philipj) nearby I could be asked to help figure out what has happened.After going through only 10% of our IDL files I've added 142 FIXMEs, about 1 every 16 lines. It's the eventual number of TODO(philipj) that makes me a bit uncomfortable, but maybe I could get used to it. Or maybe FIXME isn't the best way to annotate differences with the spec.IMO TODO(philipj) is appropriate in this case, and you don't need to be uncomfortable at all. TODO(philipj) doesn't mean you were wrong or you need to fix it. If the comment has enough information, none will ask you about the comment.The name part of TODO(philipj) may be helpless in this case, but is good for consistency.