views:

168

answers:

2

I've noticed that the majority of enterprise web apps I've worked on over the past few years have seemingly mis-used the powers of oo.

That is, what once would have been perhaps 1000 lines of HTML and script, has often now morphed into 10,000 lines of code, 50 classes, and 2000 method calls to do basically the same thing. I.e. oo and layered architecture appears to be over-used and/or ill-used, often leading to longer development times, higher-cost, and often nightmarish maintenance.

  • How often are other people seeing this happen?

  • How can oo be effectively utilized to, as the Buddha himself has said: as much as possible try not to harm...as much as possible try to help...

+1  A: 

I see these all the time :( Basically if people are going to do a mess they will do it trying or not to use oo design. It gets equally awful on either case.

Update 1: it is important to understand how/what will be reused (but not going crazy on it as that would hinder productivity), since we don't want to get tons of classes where every single one of them aren't reused and fulfill tons of different functions.

Basically the main issue is understanding and caring for what is being built, as you could apply oo, tdd, ddd, anything, and if the devs doesn't understand what they are doing it will end up in the same mess ... or worst :(

Bottom line, these things do help, but they aren't magic, they won't replace the developers skills to create maintainable code.

Update 2: Also note that a checklist or some bullet points won't do it. I mean I love SOLID, and plenty things going on and I think they really clear things up, but they usually make the most impact on the people that have been trying to avoid the mess.

eglasius
I agree with your point too Freddy. Bad devs are bad devs and they just don't know how to use the tools. Tools can make things easier, but if not used right they can also hurt. Part of writing good code is wanting to write good code and having the passion for software development.
Jesse Dearing
+1  A: 

"The road to hell is paved with the best of intentions."

I haven't personally encountered this myself, but all the times I've heard stories it seems to be an issue of architecture astronauts (people who spend too much time thinking) or bad developers (people who spend too little time thinking).

In the earlier days of programming, you didn't see as much of this because of the limits of the hardware, languages, etc.

However, developers are now are trying to focus on writing code that's understandable by humans for loose coupling and higher maintainability by incorporating as many design patterns and OO principles as they can, but just like everything it can be over-done.

On the other hand, some developers might just not be thinking enough about the problems they're attempting to solve and writing extra code just because it gets the job done and not thinking about the bigger picture.

In either case, developers might not be malicious or even incompetent and want the best for the projects their working on, but they still over-do principles simply because they are trying too hard.

So I would say the solution is to remind developers to use OOP principles as guidelines, but just that. There comes a point when you have to find a happy medium between thinking and programming and just stop thinking and start programming.

See: Jeff wrote a good blog post about just this kind of thing: KISS and YAGNI.

Jesse Dearing
I really think the real issue is that the code of these devs is a mess using OOP principles or not. It is just a different mess :( ...
eglasius