Hanalei, Hawaii 9/2/2010
438 Posts and Counting

You’re Not Your Data Access

Thursday, June 11, 2009 - Seems I touched off a bit of a “swirl” with a comment I made on my last blog post:

I think, in general, the .NET crowd overthinks and over-engineers just about everything
I said as much in my MIX presentation, where I basically challenged ASP.NET developers to “embrace their inner scripter” and stop building rockets. I have a fairly strong opinion on this – and I’ll save that for another time – but I think it’s high time to remind folks that there’s a lot more to an application then how you get your app gets it’s freak on with your database. Good Morning! I remember watching Fight Club for the very first time back in the thick of the very first DotCom bubble. I was feeling pretty ill that day so I stayed home and watched the DVD, and was pulled in pretty dramatically. One line still resonates with me:
You're not your job. You're not how much money you have in the bank. You're not the car you drive. You're not the contents of your wallet. You're not your f******* khakis.
I feel the same way about building software: You’re Not Your Data Access. When I watched that movie I had just bought a nice pair of $180 Kenneth Cole shoes to wear to a client’s VC meeting, to go with my groovy business-casual Cornflower Blue button down shirt. I clearly remember looking over at my closet – the feeling of fashion sobriety coming over me – wondering what I had turned into (if you knew me then you’d know I don’t like wearing that kind of stuff. I’m happy in a white t-shirt and shorts). I had this same feeling when I popped my head out of the .NET community just 4 years ago (before I worked at Microsoft) to see what this “Rails thing” was all about. I remember the feeling well – and it was very, very sobering and inspiring at the same time. I remember creating an application in fairly short order with all the requisite pieces put where they needed to be put, with every tutorial urging me to “stop thinking – just build”. Camaro Programming The .NET platform is pretty dang powerful. It lets you build your own personal Tower of Babel if you so choose, and it can abstract away the very fabric of space-time if you let it. In short it’s a killer set of tools that any mechanically-inclined person would love to use. So naturally it can be very easily abused! Consider my good friend Eric. I’ve written about Eric a few times before – but in summary he’s my token wrench-head friend that loves his engines and American cars. I lived with this guy for years and he rapidly filled up our garage with parts and *crap* from every car he’d ever owned. And he could dutifully tell you which part went to which car and what that part did – no matter if it was useless. Eric built and maintained a hunk of junk 1968 Capri which we used to call “The Crappy”. This thing could drive – and I mean really drive – I think Eric pushed it to 180 mph once on a closed race course. It had that sound that all muscle cars make – the sound that makes your ribs shake and your inner 16 yr old say “coooooolll!”. The problem was that no one ever wanted to drive in it. It smelled, it was ugly, and it absolutely sucked the gas down. Eric would steadfastly defend his Crappy because “it was the easiest car in the world to work on” and “could blow doors on any production car from any country”. “Yah but when do you really need to go 180 miles an hour man?” “When I race dammit” I don’t need to draw the parallels here. I think you get it. Let it Go Already I want to be perfectly clear about what it is I’m saying here, and that is that it’s very, very easy for the geek inside us to whisper sweetly in our ears, saying “this Super Massive Paradigm Shifter will be the biggest application EVAR… don’t mess it up!”. I felt this very sensation when starting … well every app that I ever made. I don’t like being wrong – no one does. So defensively I’ll be sure to include patterning where I can, making sure to separate out my projects whenever it … seems like I’ll crap for not separating out what I’m doing into another project. I’ll use enums instead of boolean parameters. Oh wait, no I won’t. I’ll be sure to avoid Singletons I’ll absolutely never use Stored Procedures, I mean seriously never, ever, ever (unless Rob Howard tells me to). Or maybe unless my boss tells me to. I’ll let Jeff decide. I’ll always use Stored Procedures. I won’t use NHibernate I won’t use any ORM for that matter. Seriously - Never. Well I might use both… I won’t use Code-coverage to tell me anything. I’ll be sure to use Code-coverage data to tell me everything. I’ll make sure my method and variables are named properly on Fridays. Reflection? Not a chance. Unless Rick says it’s OK. I won’t use Extreme Programming (I’ll be sure to use Lean… whatever that is) I’ll be sure not to have scrums. I’ll also be sure not to multi-task. I won’t use configuration either – hard-coding FTW! I won’t use static methods I won’t use extension methods I’ll keep Native American stereotypes out of my code. I’ll make sure that all my methods are public and never sealed or internal I’ll check twice before I use any of these evil keywords. I’ll also make double damn sure not to use regions in my code – ever. I won’t use VB (who would?) and I’ll be sure to use C# with great care. I won’t use Composite Keys in my database And I’ll be very, very sure to keep away from Norway.
You wake up at Seatac, SFO, LAX. You wake up at O'Hare, Dallas-Fort Worth, BWI. Pacific, mountain, central. Lose an hour, gain an hour. This is your life, and it's ending one minute at a time. You wake up at Air Harbor International. If you wake up at a different time, in a different place, could you wake up as a different person
Let. It. Go. Summary Simplicity is beautiful. Simple doesn’t mean hard-coding, it doesn’t mean cutting corners or being sloppy – it means building what you’ve been asked to build, not a rocket to Saturn and most of the time it’s a skateboard to the corner store. Not every application needs to be stitched together from Codebetter posts and Twitter rants. Focus on what’s important – the experience, not what’s under the hood. You’ll change that quite a few times no matter what you think :).

Related


Gravatar
Bill - Friday, June 12, 2009 - Awesome. Couldn't agree more Rob. Don't build a spaceship to cross the road!
Gravatar
Ryan R. - Friday, June 12, 2009 - Beautifully said Rob. We're always having these religious debates about what's right and what's wrong, with most having no clear winner anyway. These things are obviously important to us, or we wouldn't be having these conversations.. what it really boils down to is whether or not you're creating compelling software that works. If what you're doing is working, and there are no legit arguments giving you a reason to change, why shift just because Person X says that Y is better? We could read endless books and blogs, learning about every possible design pattern or best practice, but sometimes you just need to get your hands dirty and write some code.
Gravatar
vincent - Friday, June 12, 2009 - Great post Rob. I tend to be confused at all the info passing around on the internet, the clashing opinions, the patterns, anti-patterns, non-patterns, pattern-patterns. You're right!
Gravatar
Paul Batum - Friday, June 12, 2009 - Usually I enjoy your posts Rob but this one didn't sit well with me. Stating that we should be avoiding over-engineering without providing actual examples of this over engineering is an empty statement. Its empty because without examples, everyone will just nod their heads and say "yes, yes, over engineering is bad", all while picturing something different. The links you provided help illustrate some of the different perspectives on a range of topics, but I don't see how they relate to over engineering. What are you trying to say? That we're thinking too hard? We have too many different opinions? I love Fight Club, I'm a big fan of Chuck's writing. But "You are not your data access" is not a meaningful statement to me.
Gravatar
Peter - Friday, June 12, 2009 - I know the feeling..., for me it usually is a sign that I need holiday... quickly.
Gravatar
Jesus - Friday, June 12, 2009 - Camaro programming. As a proud owner of a Camaro, that made me laugh
Gravatar
Jesus - Friday, June 12, 2009 - lol, it's certainly not the first Jesus joke I have ever heard :P
Gravatar
kYann - Friday, June 12, 2009 - I kind of agree with you, but i think the main problem is that "we", as the .net community, didn't find yet the perfect data access layer ;) ... Maybe subsonic will change that :p
Gravatar
Jason - Friday, June 12, 2009 - This is an awesome post. It summarizes all the feelings I've had when looking for the "right" way to build software. You follow the titans of the industry and listen to all of their experience and guidance but for every industry leader you follow there is another industry leader saying the exact opposite. Write software that _you_ are comfortable with. Follow the patterns that fit for _you_. Great post, I'm pumped to start the day.
Gravatar
Jeremy - Friday, June 12, 2009 - @kYann "didn't find yet the perfect data access layer ;)" That's the problem that I think Rob is hitting on. Perfect is the impossible holy grail. Functional (does what it needs to do (ie get data in and out of the database easily) should be what we are striving for.
Gravatar
Joseph Daigle - Friday, June 12, 2009 - "Functional (does what it needs to do (ie get data in and out of the database easily) should be what we are striving for. " And even with this qualification each project's data access requirements will be uniquely different. I doubt you will ever find one-size-fits-all data access code. In the "old days" I would essentially write my own wrapper around ADO.NET for each project. I wrote my own SQL queries but they were safetly tucked away in the wrapper. Since then I've gone through ORM after ORM and the only useful thing I've taken away from them is query generation. Now I've effectively come full circle, except that I no longer write my own SQL queries by hand.
Gravatar
austegard - Friday, June 12, 2009 - Heia Norge!
Gravatar
austegard - Friday, June 12, 2009 - Oh, wait, this isn't a soccer match. Rob, I'm pretty sure my brethren would treat you and your other vertically challenged peeps (that's you Haack: http://twitter.com/haacked/statuses/2128185794) very, very well.
Gravatar
Jim - Friday, June 12, 2009 - Great read. Thanks Rob!
Gravatar
Chad P - Friday, June 12, 2009 - I read this post and heard the following: Let's focus more on building apps that people want to use and less on debating the next great data access layer. I think Rob's project demonstrate this too. Thumbs up.
Gravatar
Mitch Labrador - Friday, June 12, 2009 - The model that wins is usually the one that has the most bragging rights! When you get together with other techies you don't say, hey guys look at the cool app i built that hit the budget, and solved the client's problem. We usually like to brag about our data access pattern or weather you are using the provider pattern with a completely abstracted DL that can easily be switched to use a different database server without having to re-write the application.. blah ... blah... blah. The truth of the matter is that the client will most likely never want to re-write the DL. But that's the geek in us. We like to tinker by default and like technology for technology's sake rather than the business problem it solves. There is beauty in simplicity, but then how to accommodate the Elvis programmer in us?
Gravatar
Ryan - Friday, June 12, 2009 - Rob, Thinking about Ted Neward's essay "ORM is the Vietnam of Computer Science" while reading your post gave me the mental picture of a Hippy in a tye-dyed shirt making a peace symbol with one hand and saying "Make apps not war". It's a good post and a lesson I hesitantly learned from my last boss. I think working at a software company really helped change my mind on being OCD about trying to create perfection with every coding effort (and of course never achieving perfection and wasting too much time). One of the reasons my interests started drifting from .Net to Rails and then Django was the level of productivity I felt I had gained while just letting go of having to control so much. Embracing the conventions can be liberating.
Gravatar
Arthur Chaparyan - Friday, June 12, 2009 - This is the single biggest issue I've had when trying to hire another developer. I work on a bunch of different projects and just needs things to work the way they are supposed to. Anytime I've worked with a developer they over-engineered everything, and I mean EVERYTHING! When I ask them about it, their response is "well someday you might need this." Then a month goes by and all that's been done is a super fancy wrapper for another wrapper for an ORM, just in case one day I decide to change databases, web servers, and atmospheric pressure. Can we PLEASE go back to the mindset of practical work that matches the needs of the project?
Gravatar
Michael D. Hall - Friday, June 12, 2009 - Hands down, you're my favorite guy at Microsoft. I've been using SubSonic for years and I love your attitude and open-mindedness around the .NET OSS community with it's so many dogmatic prima-donna's. Keep on fighting the good fight mah brotha. One of my biggest pet-peeves is this fascination with the Uberest ORM. We, as a community of developers, spend so much time looking at our ORM belly-buttons that we lose focus on writing cool stuff and not just a boring "wheel." But it goes beyond just data-access obsession. A balance has to be struck, we need to write stuff that is maintainable, we need to write stuff that future generations can take ownership of, maintain and grow. I attended a panel discussion at ThoughWorks here in Chicago, and had an opportunity to ask the Dr. Parsons (CTO of TW) and Ola Bini (a core-developer on JRuby) their opinions on how polyglot programming would managed for the future when we already have shops burdened with legacy languages and components that have kludged up their systems already. They seemed to think my question was naive (esp. from a confessed .NET developer) but their answer, simplified, was it will take careful planning. Well, that's just dandy and very useful. (How do I get to California from Illinois? You drive. Duh.) I think it's symptomatic of the problem that you're describing, a fascination with technology. If we don't become more pragmatic as an industry and choose our tools, and languages because they are the wisest choices for the problem at hand, not because they are the new hotness, then we will continue to be viewed as a bunch of geeks in love with their toys with literal interest in the realities of the the day. (Just to be fair, the conversation did also cover how to more wisely evaluate and select a language for a problem set.)
Gravatar
Kevin Dente - Friday, June 12, 2009 - I absolutely disagree. *Most* developers overengineer things, not just .NET developers. ;) As for data access- yeah, the Rails folks have ActiveRecord. But then there's also DataMapper. And Sequel. Apparently it's not just the .NET guys thrashing on data access. I think a part of the data access thrash is that MS still has not delivered a good, simple, out-of-the-box solution like the Rails guys did. LINQ to SQL could have been that solution, but then MS shit-canned (excuse me, deemphasized) it.
Gravatar
Alan Stevens - Friday, June 12, 2009 - Meh. I'm not feeling it, Rob. Frankly we need more DRY and SoC in every area of every code base I've ever worked on. You have not persuaded me in the least. Your buddy, ++Alan
Gravatar
Thomas - Sunday, June 14, 2009 - Nothing to add to this. Great post. And it's nothing but the truth. For sure :).
Gravatar
Phil Derksen - Monday, June 15, 2009 - I love it. Stop all the theorizing crap and just build. Thanks Rob. Definitely an eye opener.
Gravatar
Phil Derksen - Monday, June 15, 2009 - I love it. Stop all the theorizing crap and just build. Thanks Rob. Definitely an eye opener.
Gravatar
Louis DeJardin - Friday, June 19, 2009 - "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exuper "I have made this letter longer than usual, only because I have not had the time to make it shorter." -- Blaise Pascal The sweet spot intersection between "just do it" and "engineer pride" is when you can show someone your code and the reaction is "that's all it took?"
Gravatar
5x1llz - Friday, June 19, 2009 - hey, I had to jump out of my RSS reader just to comment: this is a gem of a blogpost.. it could have been longer ( and meaner ) but you got the point across... I definitely think the best programmers understand SERVICE is the goal, not gadgets, dogma, paradigms or super-power-algorithms. If the customer isn't getting what they LIKE and feel like they're getting value, you're doing something wrong because that's WHO should like your work. What happens "under the hood" is just fun but only to the other dev's on the team. Customers care about functionality, usability, readiness, performance, availability and stability. that's IT. I won't even discuss price because I think if they get what they want they will pay well for it. Anyway, good post.. sure do appreciate real talk.
Gravatar
David Robbins - Tuesday, June 23, 2009 - Rob, I recall your talking about domain driven design being about what your client defines as the aspects and processes that THEY use when THEY deliver products, create widgets, etc. Your focus was that you should see the system through THEIR eyes. The starts a fundamental shift in how you approach architecting a solution for a client. I have worked with many brilliant coders who live entirely in their own domains - not what the client wanted but what they felt was required. The complexities that they put in place did not make a damn bit of difference in the end. The client needs to feel that the software is like a shadow, that they can do their critical stuff without having to think. The "extensible" should have been banned from the project as it fell on deaf ears. Yes, databases matter, yes math has work. The .Net guys need to forget about their development skills and think like their clients. During your presentation it struck me how quiet the audience was. It reminded of the time when I demo'ed jQuery to some peers, and being geeked out over how simple it was to implement I said "I don't have recompile. It's great." There was silence. Then finally someone said "You can do that animation stuff with Silverlight." and that was the end of the discussion. They had missed the point - embracing scripting once again, I no longer am reliant on huge frameworks to accomplish things that will make the customer's life better. Keep up the good work.
Gravatar
Chris Vann - Wednesday, July 01, 2009 - F'n A!!! All day long I'm deluged in commentary about TDD this and DDD that and XYZ Framework this or that and "Use this pattern, no this pattern, no don't use that anti-pattern!".