- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
It would have been done, but the Mayan Apocalypse happened frist.
Admin
And the example is what I call a "naked TODO" == there's nothing that indicates what it is that someone wanted TODO.
Since TODOs in production code are only supposed to be there a short time, and provided your team actually tries to clean them up in a timely fashion (ha!), it's quite reasonable to leave ticket numbers there. (Less opportunity to change the ticket system and invalidate all the numbers, that sort of thing.)
Admin
I can't even fathom why someone would even hardcode a value in the first place, even when first writing a method they want quick. if you need the current year it's not like it's complicated code.
Admin
Well, the world was going to end in 2012, so this is not a problem.
Admin
This is a joke that has been going since at least 1957. https://www.hexmaster.com/goonscripts/what_time_is_it.html
Admin
The real TDWTF is that it should be getNow()
Admin
Right. But do you want the year that the transaction was entered, or the year that it was closed, or the year that the report was run, or the year that the reporting period ended...
Admin
Visual Studio can be configured to make C# TODO comments into compiler warnings. Of course, making this useful requires the same developers that don't fix regular TODOs on a timely basis to adopt a "fix compiler warnings before writing new code" approach.
At the end of the day, developers that let tech debt accumulate can't be fixed any way other than to have an adult in the room with the authority to enforce sanity.
Admin
Admin
(Previous one messed up)
LOL. LMAO.
Admin
I always follow a few basic rules for todos, and this violates all of them.
If everyone sticks to the template you can even write an IDE plugin/PR review script to automatically flag ones expired/not matching the format so they can be fixed. There's basically no reason not to do this, it makes everything much easier to maintain.
Admin
No, it should be
now().Writing
getin front of it is completely redundant.Admin
But what if in the future you want to set now?
Admin
It's probably never used anyway.
Admin
touchThe(cow); get(it.now); // TODO
Admin
Ref:
Everywhere you wrote "developers" you meant to write "managers". Good developers pay down tech debt. Bd managers insist on creating tech debt. And hire the kinds of developers who will go along with the mandate to create, not resolvle, tech debt. IOW, bad developers.
Admin
At my first job (40+ years ago, embedded military systems) we needed leap years. The lead promptly hard coded the next 5 leap years in an if statement saying the system will be retired before then...
I occasionally wonder if that is true or it got patched in 2007.
Admin
... or the year the code was written ...
Admin
It's not always that simple. You need to think of the project you are working on holistically and not just as a producer of code.
You are not employed to make a perfect spherical floppy in a vacuum. You are employed to create a product that will fill someone's business need. And that someone is who dictates whether the priority is correctness, performance, security, scalability, being on time and budget or something else entirely. As well as how much of those and other factors he is willing to sacrifice to gain at something else.
A good engineer knows how to adjust his project to match those requirements. And more often than not that means shipping something that is less than perfect because perfection is the enemy of done.
Admin
// TODO
// TODO - Describe what the above TODO is referring to.