this.Blog.Find(entry => entry.IsHelpful);
 Wednesday, January 14, 2009
Put Down That Golden Hammer!

In case you’ve been living in a cave on Mars with your fingers in your ears for the last year, you’ve probably heard we just ended a little election here in the United States.  I’m not big on the whole politics scene, so I’ll spare you much further discussion on the subject, except that I just don’t *get* why people blindly pledge their allegiance to extremist political views (no matter which side they’re on).   Yet people by the millions are quick to eat up the junk spooned out by people like Rush Limbaugh, (fellow Cornell alum) Keith Olberman, (fellow Cornell alum) Ann Coulter, Sean Hannity, Bill O’Reilly, etc.  If you ask me, they’re all equally wackos.

The same phenomena happens in the software development community.  We as an industry are very divided on what we hold to be the best technology, whether it be operating systems, programming languages, IDEs, frameworks, etc. 

Maybe it’s the middle child in me or the fact that I’m a Libra, but I tend to take a more centrist view on things.

I’ll share two quick items about my past:

  1. At one time, I was a snobby Java programmer at the height of the dot-com boom.  If you told me during the early part of this decade that I would be making my living doing (egad!) Microsoft development for a living, I would have called you bat-shit crazy.  But a funny thing happened … I got exposed to C# on a project I was on (i.e. it was mandated we use it), and it turned out to be (IMO) a better version of Java.  And .Net was a wonderful development environment!  It wasn’t at all like going to “the dark side” as I would have been led to believe by my Java brethren.
  2. I’ve known my friend Brad, another software developer, since college.  Though neither of us were CS majors, somehow we both ended up in the software development field.  Here we are close to 15 years removed from school and both have taken much different routes to get to where we are in our careers.  While I have toed the corporate line and always stuck to “enterprise” software development (i.e. Java and .Net), Brad has been fascinated with open source technologies, functional programming languages, alternative databases, and highly concurrent systems (way before any of these gathered mainstream momentum).  In short, about 180 degrees from my development background.  Now that he has moved to Atlanta, in the last few years he has been a great influence on me and my view of the software development world.  In fact, part of the reason I so quickly latched on to the new dynamic-language-type features introduced in .Net 3.0 (e.g. lambda expressions, closures, extension methods) was directly because of his influence since he had been telling me about them in other languages for so long.  Once I finally was exposed to them first hand, I quickly understood where he was coming from.

The lesson I’ve learned is to keep an open mind when it comes to software development.  Too many times, we let pre-conceived notions and technology prejudices influence our decisions.  (Want to know a dirty little secret?  I like Vista … a lot, actually.)

I’m finally reading the Pragmatic Programmer (I know, I know, lay off me!), and though I’ve heard it re-told many times by many people, there is a classic adage in the book about learning a new programming language every year.  There’s a reason it’s re-told so often.  It’s because it’s really excellent advice.  If nothing else, it will help broaden your horizon when it comes to tackling problems in your day-to-day programming language.   It can open your mind to an entirely different way of thinking.  As humans, we’re creatures of habit.  We need something to shake things up occasionally.

The reason I’m writing this post now is that within the last few weeks, I’ve been exposed to technologists wielding “Golden Hammers”.  If you’re not familiar with the term, it refers to people who get so focused on a particular technology, they think it will solve every problem thrown at them.  “Sharepoint can do that!”  “You need to employ a 100% SOA so your website can scale, no matter how many users you are projecting!”  “Let’s write an iPhone app for this niche blue-collar customer base!”  When you have this Golden Hammer, everything looks like a nail.

It’s perfectly fine to have your convictions.  Being passionate about something, whatever that thing may be, is one of the highest highs you can get in life.  But don’t stick your head in the sand when it comes to technology.  There is no “one technology to rule them all”.  Try to be objective in your decisions.  Use common sense.  Weigh trade-offs for choosing one technology over another.  Practice pragmatism.  And use the right tool for the job.


Kick it on DotNetKicks.com
Wednesday, January 14, 2009 12:23:06 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  Agile | Programming

 Saturday, October 18, 2008
Upcoming Events

Looks like a busy end of the month for me.  I am going to try to attend the following events in the next two weeks:

Atlanta Geek Dinner

Shawn Wildermuth is hosting another Geek Dinner on the north side of town, at Pappadeaux’s in Alpharetta on October 23rd.  I’ve missed the last few, so I’m really looking forward to getting back in the mix on these.  I love Pappadeaux’s, but hate the fact it’s in Alpha-tucky.  Oh well.

Pappadeaux Seafood Kitchen
10795 Davis Dr.
Alpharetta,GA 30004
770-992-5566

 
Agile Atlanta

The Agile Atlanta User Group is deviating from their usual scheduled meeting of every 2nd Tuesday of the month for a special event on Monday, October 27th.  Jeff Sutherland, the co-creator of Scrum and one of the authors of the Agile Manifesto is presenting at Turner’s Techwood Campus location.  The topic is titled, “Hyperproductive Distributed Scrum Teams”.  This is an amazing opportunity to hear one of the true leaders in the Agile community speak.  Turner has very tight security, so they are asking anybody who wishes to attend sign up beforehand.  You will need to sign up and present a photo ID for admittance into the building.

Techwood Campus at Turner
(1015 Assembly Room)
1050 Techwood Drive N.W.
Atlanta, GA 30318

 
Atlanta ALT.Net

The Atlanta ALT.Net group is holding another meetup on Wednesday, October 29th at Thinking Man Tavern in Decatur.  The topic of this meeting is Continuous Integration.  Josh Gough has done a great job organizing these meetings, and I look forward to another interesting and lively discussion.

Thinking Man Tavern
537 W Howard Ave
Decatur, GA 30030



Kick it on DotNetKicks.com
Saturday, October 18, 2008 6:30:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  Agile | alt.net | Programming | User Groups

 Friday, October 17, 2008
No Comment

During our daily standup the other day, one of the developers was complaining about the lack of commenting in a module that was written by a 3rd party consulting firm.  This got many frustrated nods from the other developers in the group, which in turn led to a discussion of comments overall in our code.  There seemed to be a general consensus among the group that the commenting in our code needed to be improved overall.

The reason I found it interesting (and by interesting I mean to me only) was the the timing of it all. 

I’ve been on a kick lately to read nothing but Agile books (instead of the usual books on specific languages or technologies).  The one currently occupying my bedside table is a book by Robert C. Martin (aka “Uncle Bob”) called Clean Code : An Handbook of Agile Software Craftsmanship

Literally only a day or two before this particular stand-up meeting, I had read the section on commenting in the book.  In fact, Uncle Bob’s views on the subject were so strong that he dedicated an entire chapter to it.  He argues that comments overall are a “necessary evil” and are only needed as a means “to compensate for our failure to express ourself in code.”  He hopes someday that languages evolve to DSLs that are self-documenting.

He reasons that comments are bad because Agile code changes over time.  Oftentimes, the comments don’t get maintained along with the code.  So the more code gets changed, the comments become further away from the current intent of that code.  In fact, he boldly states that comments lie (though not necessarily intentionally), and that inaccurate comments do more harm than no comments at all.  A bad comment is worse than no comment (maybe Uncle Bob was a lawyer in a former life?). 

Well, if that’s the case, why bother commenting at all?

He does give some examples of useful comments:

  • Legal comments, such as copyright headers, author statements, or ownership rights
  • Warning of consequences
  • TODO comments, which can be caught in IDEs as warnings

On the other hand, he provides numerous examples of bad comments:

  • Documenting a “hack”
  • Comments that mirror the functionality and/or naming of the code piece it describes
  • Poorly written comments, which can be harder to read than the code itself
  • Journal comments that log each time the code is changed
  • Noisy comments that provide no value (e.g. // ignore )
  • Position markers (e.g. //////// Public Methods /////////////)
  • Closing brace comments (e.g. // end while)
  • Commented out refactored code (a personal pet peeve of mine)

I don’t know if I agree with the extremist approach of removing all comments from my code.  But I do agree that comments are often abused as a replacement for good code.  The rule of thumb I came away from the book is: if you feel the need to document a complex chunk of code with a comment, that is a sure-fire sign of a code smell.  Step back and look at the code from an maintenance perspective.  Is this code likely to change?  What are the odds the comments will change with it?  Is the comment articulating my intent well?  Have I named my variables/methods/classes intuitively?  Most importantly - can I refactor the code into a standalone method that can be named expressively?

Comments can be useful, but many times end up being the poor man’s excuse for lazy coding.  Don’t be that guy (or gal).  Strive to make your code readable without having to resort to comments.


Kick it on DotNetKicks.com
Friday, October 17, 2008 8:54:34 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  Agile | Back To Basics | Programming