Sacred Code Cows

I wrote of my meeting w/ Neal Ford a few weeks ago. Today he has a long post on what he calls Eating Sacred Hamburger that goes into more detail of some of the things we discussed:

Software development cults tend to create sacred cows: habits and idioms that might have meant something at one time but only remain as baggage now. I tend to like to kill sacred cows and grill them up, with some nice lettuce, tomato, and a sesame seed bun. On my current project, we’re actively killing some sacred cows.

The main sacred cow he’s talking about slaughtering is Hungarian Notation for interfaces. You know, interfaces like IDbConnection and IHttpHandler.

Thankfully, Hungarian Notation has mostly been banished, except for one lingering, annoying location in the .NET world: the stupid “I” preface on interfaces. In fact, if you understand how interfaces should be used, this is exactly the opposite of what you want. In our application, every important semantic type is represented by an interface. Using interfaces like this makes it easier to do a whole host of things, including mocking out complex dependencies for testing. Why would you destroy the most important names in your application with Hungarian Notation telling you it’s an interface? Ironically enough, that your semantic type is an interface is an implementation detail — exactly the kind of detail you want to keep out of interfaces. I suspect this nasty habit developed in the .NET world because interfaces first came to the Microsoft world as COM (or, back when it started, OLE). It’s a stupid cow now, and should be slaughtered.

I agree 100% with this, though I’m guessing the next time I write an interface, I’ll have to go back and delete the stupid “I” because I’m so used to writing it.

The other convention he’s looking to do away with camel and pascal casing, which is convention in .NET. He’s a bigger fan of using underscores between words (which is big in the Ruby world). So far, he’s only using underscores in his test methods since they tend to be longer, such as “Verify_end_to_end_security_connectivity_to_infrastructure”. Frankly, I’m ambivalent on this one. I’m pretty good at reading camel and pascal casing and I would hope never to see a production method name like that.

So that’s two down, but there’s still an entire herd of sacred cows out there. What other ones do we need to get rid of?

ActiveRecord::Migration

When I wrote about the Dual Schema problem a few weeks ago, I specifically wrote that the Rails model is backwards because it derives the in-memory schema from the database schema. While I still believe that, Rails’ ActiveRecord::Migration library does make it significantly easier to manage the database from Ruby code. For those not familiar, ActiveRecord::Migration is a series of Ruby script files that define the database schema. Inside each migration script is an up and down method, so you can migrate forward and backward in the history of your project. And it provides easy to use abstractions such as create_table and add_column so you don’t have to geek out on SQL syntax (unless you want to). Once you have a collection of these scripts, simply calling rake migrate will bring your database instance up to the current schema (rake is Ruby’s equivalent of make). Or, you can set your database to a specific version of the schema by running rake migrate VERSION=X.

I wonder why the Rolling on Rails tutorial uses the database tools directly instead of ActiveRecord::Migrate? I’m thinking it wasn’t available when the tutorial was written. Whatever the reason, they really should update the tutorial to reflect the current state of Rails.

Apparently, Microsoft Delivered on Enterprise 2.0 Three Years Ago

In the past few weeks, there’s been a major uptick in discussion about Web 2.0 / Enterprise convergence. Andrew McAfee has a new article on what he calls Enterprise 2.0. Dion’s got an entire blog on the subject, though he thinks it should be called Enterprise Web 2.0. Nicholas Carr is skeptical. Seems to me all this discussion about what might happen in this space is pretty silly since it’s happened already.

Unfortunately, Andrew’s Enterprise 2.0 isn’t freely available (you can buy a copy of the PDF for $6.50), but it primarily focuses on the growing frustration with email and the rise of collaborative Web 2.0 technologies such as blogs and wikis inside the enterprise. No big shock here – for collaboration, blogs and wikis are to email what word processors are to typewriters. Andrew also introduces a model he calls SLATES for describing the aspects of these technologies: Search, Links, Authorship, Tags, Extensions and Signals. So far, all good stuff.

The problem with the article is that he talks about these technologies in the future tense. For example, he writes: “As technologists build Enterprise 2.0 technologies that incorporate the SLATES components” which implies that these are coming down the pipe rather than here right now. Not only here right now, but available for going on three years. I’m talking about SharePoint 2003. 2003 as in “a year before Tim O’ Reilly coined the term Web 2.0“.

SharePoint (I’m talking primarily about the free feature pack for Windows Server 2003 though about the portal server as well) supports Search, Links, Authorship and Signals – four of the six components of Andrew’s Enterprise 2.0 stack. (And frankly, I’m not sure where Andrew is going w/ his Extensions aspect so four out of five is probably more accurate.) More importantly, it’s specifically designed to support what Dion called the Democratization of Content. As of December 2004, Microsoft’s internal IT department was supporting “more than 60,000 users, 250 group and division portals, 50,000 team sites, and manages more than 3 terabytes of information.” Personally, I use the coportate enterprise intranet portal, my division portal, a handful of team sites and my personal site on a pretty much daily basis. Only the enterprise and division portal are centrally managed. Given the explosion of SharePoint sites inside Microsoft, I’m obviously not alone.

Creating a new SharePoint team site inside Microsoft is totally self service and takes literally a few seconds. Once you have a site, you can configure it as you like, creating lists and setting permissions as you see fit. Again, it’s totally self service. Plus, it’s totally public unless you specifically lock it down (well, public inside the firewall at any rate). Of course, it could be easier and better, and that’s what next versions are for. SharePoint 2007 will have direct support for blogs, wikis and RSS. Check out the C9 video for more info.

Given the market momentum to date and the impending release of a new version, I find it very surprising to find Dion, Andrew and Nicholas discussing the potential ramifications of these technologies without even mentioning SharePoint. If these guys want to see the Enterprise 2.0 technology in action, all they need to do install SharePoint.

Lang.NET 2006

Erik Meijer just posted details about Lang .NET 2006 over on Lambda the Ultimate. Looks to be the next generation of the Complier Dev Lab I attended last month. The appear to have opened up the program significantly, and are asking for abstracts for both 30 minute talks as well as 10 minute “lightning” talks. If you’re interested in submitting, here’s the list of topics they are most interested in:

  • Dynamic languages and scripting
  • AJAX and ATLAS
  • Domain specific languages
  • Functional languages
  • Object-oriented and aspect-oriented programming
  • Web-services and mobile code
  • Libraries
  • Language-Integrated Query (LINQ)
  • Compiler frameworks
  • Garbage collection
  • JIT compilation
  • Visual Programming
  • Success and failure stories
  • Non-standard language features and implementation techniques
  • Tools and IDE support

Alex the Great

My brother sent me this great compliation video of Alexander Ovechkin’s first year in the NHL. In the words of Barry Melrose, the Calder Trophy has been a one man race for some time now. Congrats to Alex on being only the second rookie to score 50 goals and 100 points his first season.