Monday, 1 June 2009

Code Monkey on Speed

Recently, I was on an NHibernate course, with Ayende Rahien, a prominent figure in the NHibernate world. He demonstrated all the various mappings and code needed to use NHibernate. I was seriously impressed with is ability to write code and more importantly, the speed at which he did.

Usually, I am very good at following what people are doing and learning that way. Ayende raised the bar a level with his speed of typing and of code refactoring. Super human powers to refactor code, way beyond your rename and copy/paste tools available. Then I remembered the good old C Resharper addon that you can get from

I have been using it this past week (you may have noticed the slight lack of posting! I've been busy playing!) and am fully amazed with the flexibility and speed increase in development I have seen.

From my previous post about Oracle and Specifications, this week has been very much about creating a whole new business layer for our application, on that will use NHibernate to connect to both SQL server and Oracle. All my business objects will implement and interface (as all good business layers should!) and Resharper has allowed me, with a few key strokes to:

  • Create the concrete class
  • Make it public
  • Implement the interface (with public virtual auto properties) - NHibernate requires virtual properties
  • Move the concrete class to a file of it's own name
  • Manually dragging the class into it's own folder structure
  • Resharper then offers to update the namespace to match folder structure and adds an using statement where needed to refer to the old namespace

With the addition of automated code snippets (i made an interface property snippet to save even more time) I have created half the application in 3 days!

If I didn't have to buy a license for Resharper, I'd definitely buy those guys a pint! Maybe they deserve the pint anyways, it certainly has saved *lots* of time. Try it out and see what you think.

No comments:

Post a Comment