[Python-Dev] XXX do we need a new policy?

Guido van Rossum guido at python.org
Tue Nov 4 03:47:07 CET 2008


On Mon, Nov 3, 2008 at 7:35 PM, Benjamin Peterson
<musiccomposition at gmail.com> wrote:
> On Mon, Nov 3, 2008 at 6:04 PM, Guido van Rossum <guido at python.org> wrote:
>> On Mon, Nov 3, 2008 at 3:49 PM, Barry Warsaw <barry at python.org> wrote:
>>> On Nov 3, 2008, at 6:39 PM, Benjamin Peterson wrote:
>>>
>>>> Grepping through Python's sources tells me that we have over 2,000
>>>> "XXX" comments. The thing that irks me about them is that the have a
>>>> very slow rate of being resolved, since they usually act more as
>>>> "notes to self" rather than easily attainable tasks.
>>>>
>>>> So, I propose that we adopt a policy similar to Twisted's: All "XXX"
>>>> comments must have an issue in the tracker and an accompanying link
>>>> with the source code. That way we'll have a forum for discussing the
>>>> changes and deciding whether they are reasonable enough to
>>>> implemented.
>>>
>>> We have a very similar policy here at work.  Sadly I don't think it does
>>> much on actually resolving the issues.  XXX bugs tend to be pretty minor in
>>> the scheme of things and they're almost always lower on the priority list
>>> than everything else.
>>>
>>> That being said, we recognize that XXX bugs incur "technical debt" and
>>> reducing that debt is something we're devoting Real Time to doing.
>>>
>>> I see that Guido is not keen on the idea, and I'm not sure my observations
>>> help sway things one way or the other.  OTOH, it would be nice if at least
>>> we always add our own identifier (initials, nick, email address) and a date
>>> to the XXX so we at least know who was talking about what.
>>
>> At Google we use TODO(<username>): Blah, blah. I don't think ading a
>> date would help much but I wouldn't be opposed to this.
>
> That reminds me of the other problem with XXX. They get out of date
> without being removed.

Not that often.

> I've even seen an XXX comment followed by
> another asking, "Is this still valid?".

That's a clue though that the code being commented is extremely hairy
-- if the second commenter couldn't deduce whether the first comment
was still valid, a double red flag is well worth having!

> You're probably right that adding a date would help much unless we
> agreed to remove old comments with little value after a year or so.

I disagree. They should be removed when the issue they refer to is
removed. No sooner, no later. Simply removing every XXX comment older
than a year would not be helpful. The code base is so large that over
2000 XXX doesn't faze me particular. There are over 4000 files in the
Python 2.6 source code tarball!

The right thing to do with XXX comments is to read them when you're in
their vicinity, and to act when the urge becomes too strong to deal
with any one in particular. Dealing with them en masse is just asking
for a migraine.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list