Monday, November 19, 2018 ..:: Home ::.. Register  Login
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
   TechTidBits (Blog)  

///todo - If you can see this then you're too close

Sep 10

Written by:
Wednesday, September 10, 2008 10:32 PM  RssIcon

Hopefully you've all heard of XP, Agile, TDD, BDD, but have you heard of ///TODO Management?  If you're using Visual Studio, have you see the ///todo tag in action?

How many times have you been in a groove, total head's down coding, music-a-pump'n and you're dancing across the keyboard like a Miata on the twisties,when suddenly, you stumble upon something you need to address?  You're in a groove right, do you really want to do this right now?  Maybe you just want to give yourself a reminder and come back to it later?  Ya that's it, you'll remind yourself later....hhhhmmm anyone see a potential bug growing here?

What would you do?  Maybe you find a Post-it Note and stick it on your monitor (until it falls off into your coffee :<), or maybe you put in a comment in your code?  But without any active reminders, what is going to bring you back to that exact line of code which will eventually require your attention?  The Post-it will at least fall off someday (hopefully before RTM! :>).

Visuall Studio has long had the concept of Comment Tokens.

Tools|Options|Task List


Notice in the Token List the HACK and TODO keywords?  Those are tokens you can enter in your code and they'll show up in the Task List Window.  The following snippet of code illustrates their use. 

Todo and Hack tokens illustrated

There is one ///todo and one ///hack in the code and when you enter in the three slashes (///) and then one of the tokens (which you can add your own if you don't like Microsoft's :>) it wil show up in the Task List Window.

Task List Window

That is great news!  Now when you're flying across the keyboard whipping up that new class and something pops into your head that you have to do, just not immediately, try out the ///todo tag (case insensitive).  When you want to go back to address those "things," all you need to do is open the Task List and double click on the lines you want to goto and your hyperlinked over to that line of code!  That's cool!

Caveat:  There is ONE gotcha with this one jewel Microsoft gave us.  The Task List Window only shows the ///todo tags for open documents.  In other words, if you have a solution or project with a boat load of them in there, you'll have to do a Global Find for all the ///todo or ///hack or anything else you have.  There are some other tricks out there to help but that's for another blog.

So what's with the ///TODO Management I talked about before?  I read in a blog earlier this summer (I can't seem to locate the reference at this time :<) a very interesting and unique project management style one lone developer was discussion.  He suggested starting to code up small objects with ///todo tags (planning/architecture) and then after sufficient time had passed and enough planning done, he/she would go through the tags one by one and knocking them off the list.  He would do a search and then pick which ones he wanted to do and when there weren't any more ///todos left, he was done.  I don't suggest I'm going to start doing this, but the idea is an interesting one none the less, IMHO that is. :>  Even if you don't plan on managing your next projec this way, you might find the ///todo tags very useful! 

Location: Blogs Parent Separator TechTidBits

4 comment(s) so far...

Re: ///todo - If you can see this then you're too close

So first of all, I read this because you said something about Agile in the first couple lines, and so I read this, and I'm not sure what this has to do with Agile, but that's neither here nor there.

The real reason I'm here is to inject my random comments. But this one is related to coding. The other day, I'm at work in a meeting in my director's office with a couple of other people. We're reviewing our sprint backlog (which unlike ///todo tags has something to do with Agile) which is maintained in the Microsoft beast known as Excel, when all hell breaks loose and Microsoft does its all too clever crap and hoses my spreadsheet. So, I'm fixing the spreadsheet, typing like mad, all the while everybody is watching this happen because it's being projected on the wall. Then my director says, "Did you used to be a developer?" I respond "Yeah, a long time ago." He says, "You type like you used to be a developer."

WTF? You can tell someone used to be a developer by how they type?

Unfortunately, that is about as close to a coding related comment as you'll get out of me. But if you want to have a discussion about Agile, let me know.

By darklight on   Thursday, September 18, 2008 10:13 PM

Re: ///todo - If you can see this then you're too close

Yup, I said something about Agile, but I also said something about XP, TDD, BDD. :> I was asking a question in the summary part of the blog. But the subject line did it's job it seems, it got you to click to read more. :>

re Signs you are a developer by how you type?
That's interesting. I've always been a "pounder." I've been told I type like a sledge hammer banging the keys. Could be from when I learned to type? Vic-20, but that was touch typing. I learned on those old manual typewriters (Mr. Marsden I think was our teacher's name) and you have to really pound those suckers to type. It could be that you were hunting for keyboard shortcuts and not using the mouse for menu commands? I've been accused of that too. You did VI before right?

re discussions about Agile
SURE! I have a lot to learn about agile development practises. Maybe you should start a blog about it?! :> hint hint, nudge nudge, wink wink! :>

By phenry on   Friday, September 19, 2008 12:50 PM

Re: ///todo - If you can see this then you're too close

I learned to type on those old manual typewriters too. No way I was looking for keyboard shortcuts, since I don't know any of them. I think it's just because I'm a fast, if inaccurate, typist.

I'm thinking about the Agile blog. Not sure if I'd be able to come up with enough material to keep it going though. I am however thinking more seriously about putting together a presentation for submission at an Agile conference.

By darklight on   Tuesday, September 23, 2008 10:04 PM

Re: ///todo - If you can see this then you're too close

You bring up some interesting points.

re starting an Agile blog
I know you've been doing it for a while and are some what a known expert. You got hired at a prestigious company to do exactly that right? You must know what you're doing then?! I would love to read a blog that might help me wade into the Agile waters a step at a time, maybe that's where you can start writting your Agile blog? Just an idea.

re putting presentation submission for conference
VERY COOL! Three benefits from that, immediately you get recognition at work, even before you goto the conference, people are talking about you being away and WHERE you'll be away doing! Second, you usually get free (or reduced) admission to the conference! That in itself is worth presenting. hhhmmm those conferences are what, let's say $1500 and if you do a presentation for an hour.....hhhhhmm pretty good ROI if you ask me! And lastly, you start to "build your brand" in the world. Maybe not for this job, but certainly for your next job, it could make the hunt easier cause you're more known out there! Just some random thoughts about it. :>>>>

And lastly, about inaccuracy, LOL I laughed that! :> I can type a hundred words a minute, just my accuracy is about 1%! :> haha! :> Have a good one!

By phenry on   Tuesday, September 23, 2008 10:11 PM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Add Comment   Cancel 
Copyright 1999-2012 by   Terms Of Use  Privacy Statement