Archive for July, 2009

Does It Make Sense To Use NHibernate in a Sproc-Only Shop?

I just got the following email question from a friend:

If I’m stuck in one of those loony shops that mandates that all data access has to be done via stored procedures, will NHibernate buy me much? In other words, if the tool’s purpose is to eliminate me writing SQL, but I have to write SQL anyway, is there a point?

I’ve only been using NHibernate for about 6 months and am barely struggling to emerge from the newbie stage, but my gut instinct says that you would loose about 90% of the benefits if you only ever used sprocs with NHibernate.

However, if I were in my friend’s situation I would probably still use it.

Why?

The main reason isn’t because of time or productivity savings, but rather because I would bet on the long-term viability of NHibernate and ORM’s in general.

NHiberate is already pretty mainstream and becoming more popular every day. The fact that Microsoft is now fully invested in the ORM space with the Entity Framework means that it will only be a matter of time before the traditional sproc-only mentality finally disappears from even the most conservative software shops.

In the meantime, I’m guessing that I would be able to speed up that process by introducing NHibernate into my application and my workplace even it would be under less than optimal circumstances and not save me much (if any) time in the short term.

Based on my experience with human nature, I’m betting that once NHibernate is in the dev and production environments for a while, the other developers and administrators would get used to it and eventually loosen up enough to let me start mapping directly against tables. It’s a slight gamble, but one based on pretty predictable human behavioral traits.

If nothing else, it’s much more convincing to show someone a proof of concept based on an existing app in production that you only have to slightly modify rather than on a silly Northwind example.

As far as more technical reasons, I leave this up to the more advanced NHiberate using reader to comment on. My sense is that you could still cut down on some tedious mapping code (right to left assigment stuff), but using Fluent NHibernate’s Auto Mapping feature, but I haven’t tried this out yet on sprocs so that may be (at least for now) a dead end.

Are there any other compelling reasons to use NHibernate if you worked in a shop that mandated using only sprocs for data access?

Popularity: 10% [?]

How Do You Attract Great Developers through a Job Ad?

I’ve been involved in a recruiting effort for the last 5-6 weeks and I have to admit that I’m starting to get discouraged.

I don’t want to rant about how many subpar developers exists out there because those blog posts always annoy me and strike me as pathetically egotistical.

Besides, debating whether the skills of the average developer are good or bad seems like a moot point to me. Even if I rate the overall average as positive I would still want to work with people from the right side of the bell curve (a la Joel’s Smart and Gets Things Done philosophy). Besides getting more work done, they represent the greatest learning opportunity for me personally (yes I’m a wee bit selfish in that regard).

However, that is not an easy thing to do as evidenced by my need to create the Rejectomizer 2000.

Thus we invested some time and effort into crafting a good job description that would speak directly to the type of people we’re looking for.

Here’s an excerpt.

Who you are

You are a combat-hardened, grizzled C# veteran with years of coding experience under your belt. You’ve been using the .NET framework since its inception and know the ins-and-outs of threading, reflection, generics, and lambdas. You’ve done a fair share of ASP.NET and know how to use AJAX and Javascript frameworks like JQuery to good advantage. You’re interested in the possibility of eliminating boiler-plate SQL code with a good Object Relational Mapper and open to improving the design and reliability of your code through Test-Driven Development.

You are NOT the type of developer to just get things working without knowing exactly how and why they work. And while you’ve put out some pretty advanced, complex code, you’ve come to the realization that good code is simple code. If the developer sitting next to you can’t open your code and pick up where you’ve left off, your code isn’t that great after all.

While your code might be solid and you know a ton of stuff, you are constantly learning. You read technical blogs and books and try to stay on top of relevant technologies and patterns.

Aside from your technical ability, you pride yourself on getting things done. You’ve used methodologies and standards with a group of developers and know that sticking to the process helps everyone crank out quality work and get it out the door on time. You have a super-strong attention to detail and you take pride in your work. You’ve mentored junior developers and know when to hold their hand and when to let them beat their head against the wall for a while.

Finally, you’re a natural leader. You lead by example and set a high standard. You know when to be firm and draw the line, and when to solicit contributions and feedback from the group. You give clear direction and assign accountability, and everyone on your team feels like they’re doing their part.

Are we missing anything?

Oh, and if you happen to live in the Kansas City area (not accepting telecommuters at the present time) and are looking for a job at a cool company, shoot me an email

Popularity: 10% [?]

return thoughts.Where(x => x.IsCaffeineInspired)

It’s too hard to pick just one topic to delve into after a five month blogging hiatus, so I thought I would reenter the blogosphere by just spewing forth some random thoughts that have been floating around in my head lately.

  1. Lamda soup is yummy – As you probably guessed from the title of the post, I’ve currently got C# 3.0 on the brain. I’ve been burning through John Skeet’s most excellent C# in Depth: What you need to master C# 2 and 3 book this last week and am finally beginning to grok some of the finder points of anonymous delegates, lamdas, and closures that have alluded me up until now. I especially like how the book explains the original problems that the new language features were attempting to address and also how it provides most of the examples in 1.1 first before showing how they can be rewritten more efficiently using the new 2.0 and 3.0 language improvements.
  2. Side projects kill blogs – I started a side project back in February that has allowed me to learn a whole slew of frameworks that I’ve been itching to try like the MVC, NHibernate, Fluent NHibernate, JQuery, Windsor, and Sharp-Architecture. Unfortunately the pressure of learning all of those fun things on top of actually getting some work done pretty much sucked up all of my free time that used to go to blogging. By the time I finished the project a few months ago I was so burned out that I went on a fiction binge with such books as World War Z: An Oral History of the Zombie Wars, The Road, and Cryptomonicon. I think I’ve finally regained my sense of equilibrium enough to where I can start slipping some blogging back into the mix again.
  3. Turning my back on Active Record – Last year I started down the path of using Castle’s ActiveRecord as a way to use NHibernate without all the messy XML mapping files. After having a chance to work with Fluent NHibernate, I’m ready to ditch the messy attributes and nasty inheritance dependencies of Active Record in favor of a more POCOesque approach. Clean entity objects AND no xml files? What’s not to love?
  4. Third party controls are obsolete – When I decided to use Microsoft’s MVC Framework, one of my biggest concerns was the lack of built-in or third party controls. That was before I started to explore JQuery’s vast plugin community. With just a few lines of code and include files I was able to produce really nice looking calendar controls, autocomplete text boxes, media players, complex validation controls, and tool tips. It’s hard to imagine shelling out money for third party web controls ever again.
  5. Bringing recruiting to the next level with the Rejectomizer 2000 – We are hiring for not one but FIVE separate positions in our department and yours truly has the dubious honor of being neck deep in it. As a polite gesture, we decided to send out an actual rejection email to anyone who went to the trouble to at least include a personalized cover letter with their resume. With our candidate pipeline being constantly refilled by 3 recruiters, Career Builder, and a stumbling economy this task quickly became a tedious chore…that is until I brought the full power of PowerShell to bear on the problem with a script that has affectionately been dubbed the Rejectomizer 2000 (source code to be provided in a later post). My most recent enhancement included adding a sound effect to the script of a flushing toilet, which I admit is totally cold hearted but at the same time it does help relieve the bitterness that tends to build up after sifting through hundreds of poorly formatted and otherwise indecipherable resumes in lieu of doing cool coding stuff.
  6. Swimming against the Information Stream – While my 15 month old now twitters in her crib and my grandma reads her RSS feeds on the smart phone that is embedded in her walker, I have taken bold steps to swim against the current information tide by devoting myself more to good old fashioned tree killing modes of learning. I suck at multi-tasking and am sick of feeling like my knowledge is becoming more and more spread thin these days, so I’ve lined up 10 technology books that I’ve been meaning to read forever and decided to go on a strict RSS and twitter diet until I finish every last one of them.
  7. Six Shooters should be outlawed – On a final note, I recently tested the limits of caffeine consumption by agreeing to drink a latte with six shots of espresso that one of my co-workers bought for me and then goaded me into drinking. Besides making my tongue a little numb and causing me to break out in a cold sweat, this highly potent drink, which we dubbed “The Six Shooter”, apparently sped up my response time by several orders of magnitude. According to office lore I responded to the question “what are you drinking?” before the first syllable had been fully uttered with a response that appeared to have been run through several very advanced compression algorithms. Moral of the story…don’t try this at home.

Cheers,

Caffeinated Coder

Popularity: 11% [?]