When I’m up against a tight deadline, I tend to avoid tasks which could unnecessarily eat up precious time.  These tasks aren’t always the most challenging or difficult, but I recognize them as having more than one possible solution which will result in my over-thinking, over-researching and/or over-architecting (aka wasting time.)  Time-gobbling task get flagged with a //TODO comment and a quick hack which gets the code immediately operational.  Once the stopgap is in place, I move onto other tasks and wait until the best solution comes to me in my sleep, in the shower, while playing racquetball or anywhere other than at the computer.

Most recently, I’ve needed to generate item numbers.  Each number needs to be exactly 12 digits in length and unique.  I’ve been sitting on this task and a hack (which simply uses the last 12 digits of DateTime.Now.Ticks) for roughly a week now and I’m starting to get anxious because an elegant solution which avoids a database lookup is not coming to me.  Maybe I should to shower more often?  Maybe I should generate random fake surnames instead?  In any case, there are still other tasks to complete and I’m determined to not let item numbers to slow me down.

One Comment to “//TODO Don’t Waste Time”

  1. dave thieben says:

    at least put a lock around your lookup of DateTime.Now so you avoid the risk of two servers getting the same item number.

    you might be able to use a Guid and rehash it somehow down to 12 digits. just a thought.

    d.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>