Jun 2012

Taking My Sweet Time to Write Quality Code

by Steve Wortham
Whenever possible I like to take my time when working on new projects.  I like to research techniques as I'm writing code, and try not to fall back on old habits simply out of familiarity.  Even more importantly, I want to fully understand the code that I'm writing to take the guesswork out of the process.  This is possible when you don't create arbitrary deadlines for yourself.  And the results can speak for themselves.  Incidentally, hard deadlines are the one thing I don't miss about doing web consulting for other companies.

So the past few weeks I've been working on a new parser for Regex Hero.  I had some ideas for what I wanted to accomplish with it.  And taking lessons from my old parser, I began to build something that was both faster and more powerful.  I put some finishing touches on it recently and began to write some automated tests to make sure I'm not getting any errors.  I ran another test just now where I'm ensuring that the tokenized pattern that comes out adds up to the original pattern that went in.  The test was performed by running 10 million randomly generated regular expressions through the parser.  In the end it had a 100% success rate.

I'm very pleased with the way the parser is working now, and it's going to open up a lot of new possibilities for Regex Hero.  Would it have been as good if I had rushed things?  I don't think so.