Book Review: Working Effectively with Legacy Code by Michael Feathers

by Aaron 22. August 2011 04:09

The book isn't new (published in 2005), and I'm certainly not the first to review the book (link).  I'm also not the first to tell you, it's a good book (link).

I could just leave it at that: it's a good book.  But I feel like I should tell you why I think that: because it's awesome!  Also, it's written by a really smart guy.

If that's not reason enough, here's some more detail.

When I started reading the book, I was a little apprehensive.  I was told the book is pretty dry and dense.  I was more than a little surprised to find that the book was a real page turner!  I rarely go through a technical book wanting to read the next page or chapter because of the very reason thing I was warned about with this book: dry and dense.  I couldn't put this book down.  I raved to Chris Slee about it repeatedly.  I know he was tired of hearing about it, but he was a good sport about it,  I think he even bought the eBook eventually.

Early in the book, there's mention that the book doesn't need to be read cover to cover, and it's okay (recommended even) to skip around.  There are references to later pages and chapters related to the current topic.  Those are pointing you to the part of the book that defines and describes the pattern/technique being described.  That's the one thing I did wrong: I didn't go to those while I was reading.  Why?  Because I'm OCD about not skipping around in a book.  I also thought that it was making reference to other sections, and I was afraid of getting lost!  My fear was unfounded.  One: I'm a man.  Men don't get lost.  Am I right, guys? Huh?  Two: it was just to read through the technique.  I have a finger and book marks,  I could have saved my place and gone right back.

Even though I did it wrong, the book still changed how I do my work.  That applies to both greenfield and brownfield development.

The book uses C++, Java, and .NET for examples, but the techniques can be applies to other technologies.  That is, if you understand it.  I glossed over the C++ examples and techniques.  Not because I don't care, but because...well...I guess I don't care.  I don't do C++ development, and my exposure is usually pretty limited to it.

I actually finished reading this book months ago, but it still stands out in my mind, and my work reflects the things I learned from it (you're welcome everybody working with my most recent work).  It made that much of an impression on me.

To make a long rambling shorter, the book was very good.  It was a little dry in a few places, but the information was presented very well throughout the entire book.  I now have a much different and better view of what a unit test really is, how to write them, and how to integrate unit tests into existing code.  I'm even considering reading it again.  That says a lot.  I probably won't re-read it, but the fact that I'm considering it is monumental because I never re-read books.

Tags: , , ,

The Droid Eris and Gingerbread

by Aaron 11. August 2011 00:13

I rooted my phone some time ago. I then flashed it with a custom ROM with undesirable results. I've been pretty unhappy with my phone lately because of a lack of storage space for apps, it's slow, and I get bored easily.

Do I get a new phone? No, not yet.

Do I try flashing it with a ROM again? I think Yoda said it best. You know what he said.

In my search, I discovered that some of the newer ROMs give the user the ability to move apps to the SD card. Sounds like just the thing! But what ROM do I use? I did some research and found that there is a ROM (more than one actually) that is based on the latest CyanogenMod release. I read a little about it, and I decided to do it, not try it since...you know...thanks Yoda.

The splash screen that comes up is pretty cool. Totally non-functional, but I appreciate CyanogenMod's splash screen.

I have found very little reason to complain about this ROM! It's been very stable with some minor exceptions. I find that I can't run Navigator with GPS on and listen to music through the player at the same time. After a while, the phone spontaneously reboots. Also, for some reason, it couldn't get location through GPS once.

I'm also not a huge fan of LauncherPro, which is the UI installed as opposed to something like HTC Sense. It works fine, and I've got it customized now, but every once in a while, I would accidentally start to resize a widget or icon, and it would nag about buying the upgraded version to allow for resizing your home screen widgets. Not a deal breaker by any means.

The ability to move apps to the SD card has been great for me. This made the effort of reinstalling all of my apps totally worthwhile.

After about a week, I installed an app called Battery Calibration. I reset the battery stats (whatever that is or does). My battery life has been great. I can go a couple of days without having to charge the phone. A definite improvement over the stock ROM!

I've been running the ROM for a few weeks now, which is more than I can say about KaosFroyo (sorry Kaos!). If you're getting tired of your Eris (or other older Android phone), I would definitely recommend trying one of the CyanogenMod "unofficial" ROMs. For me, it's been mostly stable, snappy, and refreshing to use!

Tags: , , , , , , , , ,

Visual Studio 2010: ApplicationIcon

by Aaron 30. June 2011 02:45

I recently had need to associate a different icon to my C# project based on the selected configuration (i.e. Debug, Release, SomeCustomConfigurationYouCreatedToBeClever).

I did the standard thing of right-click on the project in the Solution Explorer, select Unload Project. Then I again, right-click on the project and choose Edit MyFancyProject.csproj. ApplicationIcon was easy to find.

I tried several ways of setting the icon. I tried a handful of ApplicationIcon nodes with Condition attribute set to " '$(Configuration)' == 'SomeCustomConfigurationYouCreatedToBeClever' ".  I added a line for each of the different configurations.

I saved and reloaded the project into Visual Studio.  The icon it showed wasn't the icon for the selected configuration.  I checked the syntax in the CSPROJ file with no luck.  I changed it to a Choose element with multiple conditions to add a new PropertyGroup with the appropriate icon.  Again, Visual Studio showed me the wrong icon.

Finally, I added the ApplicationIcon element to each of the $(Configuration)|$(Platform).  Still, didn't work!

I decided to just try compiling the application to see what icon was embedded and displayed for the executable after a build.  The icon was right!

The moral of this story is that Visual Studio doesn't process the conditions set in the CSPROJ file, but will process it during the build.

Tags: , , , ,

Internet Explorer 9 - Awesome with some exceptions

by Aaron 26. March 2011 02:28

I installed IE9 once it was released recently.  My initial impression was, "meh."  It looked like it has some improved looks, but I noticed it took a sort of minimalistic layout ala Chrome.  I didn't like that at first, but somebody probably put some time into the coming up with the layout.  Also, do I really use the status bar anymore?  I couldn't remember using it for anything except checking what URL a link poiints to.  The status bar isn't necessary for that anymore.

I tested the browser against a couple of experiments on http://www.chromeexperiments.com.  I was impressed!  It outperformed Firefox on the same tests and performed comparably to Chrome and Opera.  I tested it with GeoDocs, and it was faster than it's IE8 sibling.

I checked out the Developer Toolbar that's built into the browser and was more than a little pleased to find that there's now, much like Firebug for Firefox, a network tab.  Now I don't have to use Fiddler2 or the Web Development Helper to monitor web requests in IE.

Now for the exceptions.  With every version of IE comes some new style issues.  Several sites that I visited have layout issues in IE9.  Nationwide Children's Hospital, for example, has an issue on their home page (at least) where the middle content renders after the right column.  Why can't Microsoft be consistent with padding and margins?

The other thing that I noticed is that the editors in both blogs that I maintain don't work.  In Wordpress, the editor isn't accessible with the mouse unless I turn on IE9 compatibility mode.  The editor in BlogEngine.NET won't pop up dialogs to insert links unless, again, I turn on IE9 compatibility mode.

Those are the only real issues that I've found so far, but now I have to support CSS for yet another version of IE.  Firefox has some differences between versions, but IE has been the bane of every web developer's existence.

Regardless of my new pain as a developer, I'm very happy as a user.

Tags: , , , , ,

Progress Toward My Goals

by Aaron 21. February 2011 03:19

Today is President's Day, and my son's daycare is closed.  I just put him down for a much needed nap.  At this point, I have a lot of choices for things I can do: work, read, watch TV, write a blog post, etc.  I'm choosing to write a blog post.

My topic is how I'm doing with my goals so far.  Some I'm doing well, but others I'm starting to fall behind and miss my milestones.

Workout More

I completed my initial 6-week goal.  It was tough!  I was good for the first four weeks.  Week five, I lost motivation, but I still managed to force myself to do it.  Week six was BUSY, but I still managed to squeeze in the time.  My new goal is repeatedly complete four consecutive weeks.  How will I know if I've completed my four weeks?  I get a haircut.

Last week was week seven, and I was a little under the weather, so I took the week off.  This is week eight, and I'm running out of excuses.  Today is only Monday though, so I think I can get the exercise in this week.

Read 3 Professional Books

I completed one book a week or two ago.  It was Working Effectively with Legacy Code by Michael Feathers (blog | twitter).  I'll write a review for it in my next post.  In short though: fantastic!  I've made significant changes to how I do my work just from reading that book alone.

Currently, I'm deep into my second book The Art of Unit Testing by Roy Osherove (blog | twitter).  I'll write a review about it once I've completed it too.  This is also my first experience with a text book on my Nook.  I'll also discuss that in the review, or maybe as a separate post so I can talk about reading a text book on the Nook a little more in depth.

Summary

I could go into each of the others, but most of them I'm not making much if any progress.  I'm definitely getting better at TDD and writing more and mo' better unit tests.  I'm not making progress on video games or my Microsoft certification (which isn't called MCSD anymore).

I am also drinking less though, and being less of an asshole more patient.  Some days are harder on my patience than others.  I have very little tolerance for repeating myself, but maybe I have to repeat myself because I'm not communicating clearly.  Maybe that's something else I can work on: better communication.

Keep watching though.  I'll keep at it.

Tags: , , ,