Thursday, October 16, 2008

OOP and Programming Language Snobbery

I grill all candidates on Object-Oriented Programming skills even if they are purely front end developers. After all, ASP.NET does provide a separation between markup and logic (and also presentation, via CSS). Hence the logic portion in the C# codebehind needs to be written with proper object oriented design principles in mind.

Unfortunately some people who got their start in classic ASP have bad habits as they were accustomed to writing snippets of C# or VB.NET code directly within the ASP page markup. <% This is bad! %> They may have never needed to use O-O principles or design patterns, and hence never felt the need to develop such skills.

If candidates do not have direct experience with C#, I look for experience in C++ or Java -- languages with OO characteristics. That’s not to say that Smalltalk, Lisp, Pascal, etc. are not OO languages, but they are more academically oriented and less directly relevant to the kind of development we do. Even VB.NET, which is pretty darned close to C# nowadays, is often looked down upon, fairly or not.

Does it really matter whether a person has programmed in the O-O paradigm, or more specifically in a C++ style language? Or that they can properly describe a C# class, an interface, or a delegate? Perhaps some will see such questions as a trivia contest. However, it really does matter that developers know this stuff, so that they don’t make wrong decisions such as passing parameters by value instead of reference, making unnecessary copies of objects, calling components out of proc vs. in-proc, etc. These things do matter, and wrong design decisions have consequences.

Some people may also wonder whether this is a case of language snobbery. What’s wrong with a candidate having a background in something like VBScript, Python, or Perl, if those languages can get the job done? Why, nothing, of course. But the more (non-O-O) spaghetti code that’s created, the less maintainable the code base becomes. Plus, such an approach definitely does not scale. And maintainability and scalability are the key requirements of successful software engineering.

No comments: