Live data from Hacker News

Auto-expiring TODO notes in Ruby

github.com

31–40 of 42 posts

Re: Auto-expiring TODO notes in Ruby

#31
Silly.

I fail to understand how the developer getting the surprising out-of-context (with regard to what the developer is currently doing) build failure due to time-bomb-TODO-comments suddenly is expected to experience an energy burst and fix the issue right then and there. After all, the developer didn't fix the issue when the comment was written!

I think this just leads the developer to either a) delete the comment or b) increase the due date.

Re: Auto-expiring TODO notes in Ruby

#32
post #19

So there may not be much awareness so this, but Ruby Rails (as noted below, the annotations or part of rails/rake) has this feature that you can add special annotations # TODO # FIXME # OPTIMIZE comments to you code, and "$ rake notes" to list them. it also allows you to have a custom annotations comments : For a full description, see : http://rubyquicktips.com/post/385665023/fixme-todo-and-optim... Better to make a…

This is a Rails feature, not a Ruby feature. But building something based on this could be useful.

Thanks Andy, you are correct! The annotations are part of Rails / Rake.

Re: Auto-expiring TODO notes in Ruby

#33

Silly. I fail to understand how the developer getting the surprising out-of-context (with regard to what the developer is currently doing) build failure due to time-bomb-TODO-comments suddenly is expected to experience an energy burst and fix the issue right then and there. After all, the developer didn't fix the issue when the comment was written! I think this just leads the developer to either a) delete the comment…

After reading the title, I actually expected the code would do the opposite: remove the TODO because nobody found it to be the right time to address it over the specified period and they probably never will.

Re: Auto-expiring TODO notes in Ruby

#34
post #23

Earlier quoted context omitted.

Alternatively, you could continue using your editor of choice for editing and use grep to identify TODOs in your code.

Yes, if you're disciplined, and remember to do this regularly. But humans aren't perfect.

In smaller codebases you can use a git hook to display your TODOS: http://oinksoft.com/blog/view/5/

Re: Auto-expiring TODO notes in Ruby

#35
I'd see this with more value as a post-commit git hook. After a certain amount of time (or date specified) it would warn you that TODOs are about to expire, and either remove them or update the date. That way it can be project-wide and doesn't require execution.

Re: Auto-expiring TODO notes in Ruby

#36
I started doing something much simpler: When working on a project I just create .todo files anywhere it makes sense. This way I can view, edit, add, and remove them very easily with simple shell commands.

I just enjoy the simplicity of `echo 'remember to test the milk' >> foo/.todo`.

Re: Auto-expiring TODO notes in Ruby

#37
Horrible implementation approach. Mixing runtime exceptions with project management that you're not guaranteed to hit while testing? lol.

A pre-commit hook is the way to go,

* Post-commit: You'll always catch the exception, but you'll be able to commit expired TODOs

* Pre-commit: you'll have to explicitly change the expired TODOs either by removing them (irrelevant TODO, todo became todone through a refactor, etc.), or discussing a better end-date ... but either way, you're forced to address the expired TODO and not run the risk of committing expired TODOs nor not taking a test path that would miss the expired TODO exception

Re: Auto-expiring TODO notes in Ruby

#38
post #5

Might it not make sense to invert the parity of the environment variable and require its being set for do_by to be used? I imagine most would rather set an environment variable in their dev environment than ensure it gets set in every possible production instance... :/ As much as 'turning off asserts' is the classical style, that's more to do with the design of older instrumentation than the sanity of it.

Good suggestion! I have noted it: https://github.com/andyw8/do_by/issues/2

And it's now implemented thanks to joallard.

Re: Auto-expiring TODO notes in Ruby

#39
post #33

Silly. I fail to understand how the developer getting the surprising out-of-context (with regard to what the developer is currently doing) build failure due to time-bomb-TODO-comments suddenly is expected to experience an energy burst and fix the issue right then and there. After all, the developer didn't fix the issue when the comment was written! I think this just leads the developer to either a) delete the comment…

After reading the title, I actually expected the code would do the opposite: remove the TODO because nobody found it to be the right time to address it over the specified period and they probably never will.

Developers often add TODOs for tasks that seem essential at the time, but later become redundant.

There is also the use case of when you can't do something because you're dependent on something else, for example you might have a workaround due to a issue in one of your dependencies. Once that's resolves, you can update to the newer version of that library, and remove your workaround.

Re: Auto-expiring TODO notes in Ruby

#40

I started doing something much simpler: When working on a project I just create .todo files anywhere it makes sense. This way I can view, edit, add, and remove them very easily with simple shell commands. I just enjoy the simplicity of `echo 'remember to test the milk' >> foo/.todo`.

I like your example. Especially because milk expires ;).
Post reply on HN