Become a fan of Slashdot on Facebook
Many of Kubernetes 2,000 TODO Comments Appear to Be Forgotten (medium.com) 9
“We’ve been working on a project that surfaces TODO comments in a codebase to help developers do basic project management workflows within that codebase,” reads a new essay on Medium. So what did the software learn from over 2,000 TODO comments on Kubernetes? Slashdot reader patrickdevivo writes: It finds that most TODOs are quite old (average age of 2+ years) and about a quarter of them have an assignee (so they’re kind of like a ticket?)
The tool used to surface the information is called tickgit, and it looks for “project management metadata” in a codebase.
The data confirms what most developers intuitively understand — many TODO comments are forgotten and typically not addressed in a reasonable amount of time. This also appears to be the case in Kubernetes, just on a larger scale.
Our project (related to Kubernetes) has a lot of these TODOs. We’ve put them in a list and starting next year we will erase the comments that are too low priority to conceivably ever receive attention. The threshold for that is if we think it would take so long to address the TODO that architectural changes are likely to occur and make it irrelevant.
- by reanjr ( 588767 ) on Sunday December 22, 2019 @01:48PM (#59547900) Homepage
If something is important for the functionality of the software, it shouldn’t be a TODO in the code, it should be an issue in some ticketing or PM software. TODOs that end up in code should be expected to languish, as we already know they are not important to the functionality of the software.
But that doesn’t mean they aren’t useful. At the very least they describe some bit of missing behavior that may be relevant to someone coming in to change the behavior later.
Nothing to see here.
- by RyanFenton ( 230700 ) on Sunday December 22, 2019 @01:50PM (#59547904)
TODO comments are inherently aspirational.
They’re notes to your future self, that if you want to generalize this code, to make it more useful than it’s immediate self, then here’s what you intended the more full version of this code to do.
But most of that code ends up being as trivial to re-create than it would be to look up again.
Still though, the TODOs are useful landmarks in the code space. Your eye gets used to seeing them when scanning or searching through the bulk code. Like writing down notes in class the act of making them, then glancing across them again puts you back in that mindset faster than otherwise.
Intentions change, priorities change. There’s very rarely a coding project where you don’t learn something important that you can apply the next go-around at a task – so your aspirations also change.
TODO: Add examples to this post.
Ryan Fenton
- by Kjella ( 173770 )
TODO comments are inherently aspirational. They’re notes to your future self, that if you want to generalize this code, to make it more useful than it’s immediate self, then here’s what you intended the more full version of this code to do.
Sometimes it’s also more or less a requirement to build the API right, if you have options A and B but know that A+B is possible but out of scope the right way is:
func( bool a, bool b):
if ( a and b ) {and not mangle it into one bool even though right now it’s a or b. Maybe it’s not ever going to become relevant but fleshing out the function call and leaving a TODO as a placeholder. Same thing with things that in idealized code should be configurable but you’re just g
- Raise an UnimplementedException. That way the TODO becomes superfluous, and someone won’t be calling func() over and over wondering why it’s always returning false.
- Then label it “Future: ” or something more meaningful.
There may be more comments in this discussion. Without JavaScript enabled, you might want to turn on Classic Discussion System in your preferences instead.
Related Links Top of the: day, week, month.
- 782 commentsIs Object-Oriented Programming a Trillion Dollar Disaster?
- 529 commentsA 60 Minutes Story on Gender Equality Accidentally Proved the Persistence of Patriarchy
- 519 commentsAsk Slashdot: How Dead Is Java?
- 463 commentsWhy Modern C++ Still Isn’t As Safe As Memory-Safe Languages Like Rust and Swift
- 463 commentsProgramming Interview Questions Are Too Hard and Too Short
Slashdot Top Deals
- Get more comments
- 9 of 9 loaded
The trouble with being poor is that it takes up all your time.