Do we all preach the same things?

January 9th, 2007

Jemery’s latest post resembles (a lot) my old Introducing Castle article, only with more eloquence, principles and patterns, and whenever I mention Castle he mentions StructureMap. Probably a coincidence.

It’s a great thing that some people rise to fight mediocrity, specially in the MS world that urges for it. It’s just natural that people that come from Visual Basic/ASP will have a hard time trying to use OOP right, which is something the Java people are fighting about since 1996. Castle Stronghold has been hired three times to rewrite applications because the client just couldn’t stand the poor quality of the existing solution anymore.

I’m not saying there are no poor solutions written in Java, or programmers that should really close Eclipse and look for a different kind of job, but I’m saying that the ratio of poor solutions on MS platform is bigger. Much bigger. Amazingly bigger. And why? I do have a theory.

Try to create a web project with MS platform. If you have VS.Net it takes about three to five clicks. Even without VS.Net it still easy. Now on Java. Create the descriptors, create the web.xml, must go to WEB-INF folder, the jars on lib folder, create the servlet, add the configuration for servlet and the servlet-mapping. Oh, better, use some ant task for generate all for you. Then you have to write a Ant build script. Even better, use Xdoclet to add meta information and have it generating the descriptors/web.xml for you. Finally drop the jar on Tomcat or Jetty, and look closer for errors on the log/output.

MS tries hard to make complex things simpler, and that is great. It’s the kind of pragmatism that led me to embrace the platform long years ago. But MS also tries to hide some complexity that you should be able to deal with or at least should be aware of. WebForms is the most appealing example. “Hey, let’s get all VB programmers ready to do Web development by creating a framework that hides the stateless nature of the web”. “Let’s restrict developers to use only a single form, all right? Yagni!” “A click on a button should fire a ’server-side’ event”. Is that only me that think that there’s something fundamentally wrong with this?

The result? Well, you know the result. It’s not impossible to create a good solution using WebForms, but it does not make it easier for you, it does not enforce or suggest a design other than override OnLoad/if (!IsPostback). Populate a data grid with a few hundred items and check the view state. It’s also possible to create a horrible solution with MonoRail/ActiveRecord, if you violate the concerns that the entities should be restricted to, but at least the a class name suffixed with Controller should give you a hint, right?

But thanks goodness there are people preaching good ways - if not the right way - to develop applications and also explaining why MS is not always right on their approach to enterprise development.

I haven’t signed any NDA during my interview process on MS, so I can disclose something that really sticked. During one of my phone interviews, it was the end of the interview, I asked for what kind of advice he, the interviewer, would give for someone assuming the Subsidiary Program Manager position. He said “bring them to reality, they always loose track of what goes on on the real world”. Interpreting this is an exercise for the reader. ;-)

Categories: General | Top Of Page | |

One Response to “Do we all preach the same things?”

FreeChickenNBeer Says:

You mean “lose” track. Unless thats what he actually said. Ha ha ha.

Leave a Reply