Geeks With Blogs

Zac Harlan

When my “desire bomb” to become a better programmer finally started ticking I was also reading the book Q.B.Q.  The basic premise of the book is changing how you look at situations and how to ask the right questions to solve the problem.  My situation was that I wanted to become a “cracker jack” developer but had a load of excuses why I couldn’t learn the tools I needed.  “I don’t have time to write good code”  *tick, tick, tick* or “Even if I write something well, the customer will change their mind and I’ll have to scrap it anyway so what’s the point” *tick, tick, tick* are thoughts that sometimes run through my head.  As factual as these statements may be, it’s my choice if I let them doom me. *tick, tick, tick*
The bomb went off.  I’ve been taught that when you want to do something well,  you find someone else that does it really well, figure out why they do it that way and do what they do.  I am fortunate enough to know a few very talented developers in the Cedar Rapids area, two of which are Tim Barcz and Chris Sutton.  Hanging out with these folks is very humbling in that they have enough knowledge to pick apart my code and patient enough to  help me figure out a better way of solving the problem.
For example:
I was writing SQL all day and needed to switch into visual studio for a quick second to hack together some zero padding code.  I sent what I had over to Tim and he suggested I just use the tostring() instead

public void Main()
    int inputString = 12345;
    //what i did
    var OutputStringZac = Strings.Right("000000" + inputString.ToString, 6);
    //what Tim suggested
    var OutputStringTim = inputString.ToString("000000");

Both return “012345” so they both technically work.
What happens if the inputstring happens to increase in length to 9?

public void Main()
    int inputString = 12345678;
    //what i did
    var OutputStringZac = Strings.Right("000000" + inputString.ToString, 6);
    //what Tim suggested
    var OutputStringTim = inputString.ToString("000000");
}End Sub

Mine returns “345678” and Tim’s returns “12345678” which is more desirable.
A trivial example I know but Tim’s method allows for greater extensibility.  If the input string is changed somewhere else in the app to now be an 8 digit integer my way “breaks”.  If I want the whole number to still be returned, I’ll have to change my code (the length in my Right function has to be an 8 now) where as Tim’s code is still fine.  Since that point I’ve changed my string padding routines to include the tostring() function where appropriate.
I figured out why he does string padding like the above and  I’m doing what he does.  O yeah, and it only took me ~3 minutes to learn this so the "i don't have time" myth also got busted.
Some of the other things that I’ve found to be relatively common among talented developers are:
1.       reading technical books
2.       getting involved in open source projects
3.       reading other peoples code
4.       not thinking they are the smartest person in the room
5.       going to code camps
6.       asking for a code review from a peer
7.       accepting constructive criticism
8.       being a part of a user group
9.       pair programming
Next stop, what to read...

Posted on Thursday, July 9, 2009 7:23 PM | Back to top

Comments on this post: Getting started on my journey...

# re: Getting started on my journey...
Requesting Gravatar...
For books: Object Oriented Analysis & Design.

I know of a really educational Software Developer book club that meets in Cedar Rapids and is in the middle of talking about this book. ;)
Left by Chris Missal on Jul 09, 2009 10:07 PM

Your comment:
 (will show your gravatar)

Copyright © ZacHarlan | Powered by: