How OO Almost Destroyed My Business
advantexllc.com/blog/post.cfm/how-oo-almost-d...Posted May 24, 2009, 9:56 PM UTC
Posted May 24, 2009, 9:56 PM UTC
I want the 10 minutes back I wasted reading that article. Aside from the fact that CF is a bloated turd he just wrote a 2 page rant with not 1 line of fact or example. Having spent several years consulting on large CF projects I can say with 100% certainty that OOP-styled CF code works and works well. When you have large teams working on a code base it provides a standard with which to code. CFC's as ugly a syntax as they have, write very well, self documenting OOP code.
The author has 0 formal CS training and clearly has never tried any other technologies to use as a point of reference. Everyone is entitled to an opinion but if you aren't able to figure out OOP and it's advantages I wouldn't call yourself a programmer.
I want the 10 minutes back I wasted reading that article.
That and I want the author fined 100 minutes (credited to my life) as well.
I know nothing about cold fusion, but I can tell the he might be okay for a website of 5 different pages. Get much more than that, and he has no clue how much extra work is going through just be because he doesn't understand how to apply basics of programming. (note, there is a third option - CF could be really messed up such that it is easier to copy and paste instead of applying abstractions - this seems unlikely, but given my knowledge I need to offer it)
It's very long and drawn out. It's written with words that make it seem specific to ColdFusion. It's written mostly without regard to introspection on the part of the author.
But, it contains a lot of assertions that can generate good discussion. It contains a lot of statements that are true about the way OO is sold by the true believers. It begs a lot of correction.
However, it made me think. It made me think about how, even with a lot of effort on the part of students, computing, programming, and OO in particular might not do a good enough job at being approachable and talking about "it depends".
Certainly there's plenty of "it depends" out there. But I wonder if, in our zeal to say "beginners should do it by the book until they can make appropriate decisions about when 'it depends'", we just leave them by the wayside floundering about in frustration.
I'm sure this post will be downvoted for the reasons I mentioned in the first paragraph of this comment, but I hope we can read between the lines, look past the obvious, and discuss the real issues the author raises, even if he may be doing so unwittingly*.
(* "unwittingly" - I don't know - I haven't asked him)
I can design a dadaist word salad generator that makes things long, drawn out, full of words that are specific to one topic, and written without regard to introspection on anyone's part.
None of those things begin to make an excellent point. There are other articles, already submitted, that make the same points concisely and in a more general way.
If the author knew any CS at all it could make good points. However his complete lack of understanding of CS and large projects means I can't separate anything good out of the wrong stuff in there.
I think this is the main point. He's trying to jump into a rather deep pool with no preparation in a setting where that depth is apparently unnecessary (I have no CF experience and can't speak to the suitability of OO to CF).
Most CS people who are any good have been trained to think abstractly. That's the real benefit of years of hard math and logical sciences at a strong college. I'm sorry, your music degree just didn't prepare you for this type of thinking.
It's not OO that's causing problems, it's a painter who thinks he's a carpenter because he can nail two boards together, angry because he can't handle the tools in a real carpenter's shop.
OO can be very abstract. But that's the point. Abstraction is essential once you get to anything complex. No one can keep the details of a 5-million+ line project in their head. At that level you need some form of abstract modularity. OO is a formalization of that modularity.
It seems like his final point is "OOP in ColdFusion is half baked," which is a lot milder than "OOP considered harmful." And it may be true - I don't know, I don't do CF.
That being said, OOP isn't a silver bullet - it's a tool that makes some jobs easier. There's no distinct advantage of an object-oriented "hello world" over a procedural "hello world." There are distinct advantages in larger projects, though.
There was a time (1991-1993) where OO would mean an application framework that you used by plugging in and extending (inheriting) almost complete skeletal code. Writing applications was (still is) difficult and it required attention to detail, hence application frameworks like OWL, MacApp, THINK Class Library and PowerPlant. In those days you didn't do much OO programming, you subclassed stub (virtual) functions to hook in the functionality you needed. You might say the only pattern applied was Template Method, and a bit of Chain of Command.
Fast-forward to today. Application frameworks all but disappeared (who uses Qt or vxWidgets? Cocoa?), you write applications from the ground up but you're expected to know and use the full panoply of OO patterns, starting with MVC. Inversion of Control is pervasive, which means that you must program an order of magnitude more code than 15 years ago. Web application development is much more difficult than desktop programming (persistent state, anyone?), but the support is less than what classic toolkits provided.
Is there an application framework for Java? No. Is there an application framework for Servlets? None is dominant, all are byzantine and convoluted. Is there an application framework for .NET? No, you must write your model, your views and tie it all with your controllers.
It's not that programming became progressively more difficult, nor that the problems being solved today are substantially more complicated than 15 years ago. I was doing client-server database-backed programming 15 years ago, in a 4th generation language. There were deadlocks then, there were races then, we had to solve problems no easier than today's.
What is different is that, today, OO is not a way to structure your code but a whole conceptual framework that you must incorporate wholesale (with emphasis on abstract analytical practices like patterns, agility, decoupling, composability, etc) if you want anything done.
The great irony is that none of those practices buy us an order of magnitude in reusability and code composability: software ICs are no nearer than they were when the Byte Smalltalk issue went out. Why do we persist in teaching these techniques and expecting them to be applied to situations where they are not only not necessary but actually detrimental?
Before objects you had composability in the form of lexically-scoped procedures. That invention was Algol's, not Smalltalk, and is now 60 years old. Before objects you had encapsulation in the form of separately-compiled modules. That invention was Modula's, and is now 40 years old. Before patterns, you had separate extensibility in the form of virtual methods in Object Pascal. That invention is now 20 years old.
All the mechanisms are in place to make programming straightforward, as it was before the GoF book and the attending enfranchising of a methodology that is dragging programming down. Why isn't OO programming simple yet?
Edit: Grammar (bad English day).
OO programming isn't simple because programming isn't simple - there is no easy way to solve difficult problems. Every time we get new tools, we can do more, and our ambition rises.
You seem to be down on design patterns, as though they're a solution in search of a problem. Is it possible that they ARE solutions, but to problems you don't have or you haven't encountered yet? MVC seemed like a lot of pointless extra work to me, until the first time I had to port a project to a different graphics system.
I'm not down on design patterns, but I do blame wholesale adoption of them as having increased the intellectual burden on programming by an order of magnitude, without a commensurate increase on the applicability or complexity of the solutions being created today, compared with 15 years ago.
I recognize the value of writing portable GUI code, but it is my opinion that its economic impact is negligible: people universally dislike portable GUIs, games perhaps excepted. For all the code that is maintained for five to ten years, what does OO programming buy you?
I think the problem is pretty straightforward.
OOP is great for library writers working to simplify the use of data and related procedures in a known space. The utility of this design effort is also reflected in the market price of this library of classes.
However, OOP is pretty stupid to waste time on as an end-user application developer, when all of your problems are fairly unique and the solutions cannot really re-use any significant amount of code.
This is the difference between DELTA spending and making fortunes by designing in detail and creating specialized power tools and Joe Carpenter creating a throwaway jig to hang a door in some customer's house.
If every carpenter instead said fuck it, I'm going to spend my time inventing reusable door mounting jigs, you'll get into the same problems modern end user programmers face.
If any of the mountains of object oriented code being written was reusable and valuable outside of that program, there would be sufficient monetary incentive to justify the effort spent. There usually isn't, because most of the code thus encapsulated is trivial and usually just rewritten in a few mins on the next app, with variable names more appropriate to that domain.
I can't even imagine the insanity construction workers would face, if they went to a job site at a new company and found a few hundred new, locally invented, unique, yet commercially non-viable building tools, scattered all over the place that everyone just ignored unless they were working on something in the same vicinity as the tool.
Food for thought.
Rome is burning and Nero is enjoying it. ;-)
It's all fault of our human nature that we can at the same time find new tools, develop new tools, understand and study tools... And yet the legacy we create burdens us as soon as a week is gone with the new things we created becoming old and imperfect.
The bridges we construct don't fall because they are generally well protected from nature's whims, so we become their sole gods, deciding when to kill them, and we never do. Many times because we are not sure we would get it right the Nth time around either.
the legacy we create burdens us as soon as a week is gone with the new things we created becoming old and imperfect
What or who makes you believe that? Let's "question everything" and "overcome your own biases" be our only guiding principles. Let's apply them to every received idea, and see what, if anything, lies behind the curtain.
The bridges we construct don't fall because they are generally well protected from nature's whims
They don't fall because we humans are damn good at building things. We've been at it for three thousand years. Good enough is good enough. Who profits from making you feel perpetually unsatisfied with your own accomplishments?
I hope I understood you ;-)
What or who makes you believe that? Let's "question everything" and "overcome your own biases" be our only guiding principles. Let's apply them to every received idea, and see what, if anything, lies behind the curtain.
Don't shoot the messenger just yet. ;-)
If the idea is not general enough my particularities of it won't help. ;-)
They don't fall because we humans are damn good at building things. We've been at it for three thousand years. Good enough is good enough. Who profits from making you feel perpetually unsatisfied with your own accomplishments?
The bridges I was referring to were the fictitious ones we create with software, with programs, not the solid ones folks are usually more proud of. So re-read it having gained that explanation. ;-)
I hope I understood you ;-)
You generally did. Only when our preconceived ideas played their role we started deviating from one-another. ;-)
That comes with the territory.
Say you are not a Nero ready to take down the old by burning it just so you could build a new Rome but this time you were ready to do it as right as possible. And there in lies some of the problems of software. Before OO, after OO. Before Web applications and the billions of computers it came with, or after them.
Client-server was all fine when security concerns were fewer and LANs were smaller/non-existent. Simpler building blocks for applications that were relatively successful in the past might not work as well nowadays for N reasons, including some natural exaggeration folks might have for building programming castles when something less magnificent would do, but as discoveries and education go, we are not always satisfied before we set things in motion, before we start developing the next version of what is supposed to fix some software development specification. Folks discover more and learn even more on the go, but then it's too late.
There is an app framework for Java. Of course, that doesn't provide a real MVC framework for you. But guess what, those exist as well. If you're using the full set of OO design patterns for most of the stuff you write, you're doing it wrong. In my experience, 90% of the time I have a common problem, I can easily find an already-written common solution to it.
Thank you for the pointers. Then again, it is my more-or-less informed opinion (I've used both, reimplemented Struts in a simplified form, discarded both) that Struts and Spring are abominations. Also, JSR-296 being 10 years later cannot be seen as anything else than a failure, by the metric that every classic Object Pascal and C++ compiler had an accompanying application framework in the package.
Higher-order functions, first seen in Lisp (which is as old as Algol), have the ability to make many OO design patterns disappear completely.
[deleted]
More words than brain cells.
Procedural design FTW!
Uhhhh huhhhhhhh...
I'll never forget the feeling of empowerment as I went from that first experience to lying in bed pawing through the ColdFusion Reference Manual, looking at all the tags and functions. It was as if, one by one, they stood up in front of me and said, "And here's how I will do something really cool..." Each one was a little gift all its own.
Bzzt! Next!
[deleted]
OO didn't almost destroy his business, being an idiot who tried to use every new shiny thing did.
Yeah, but that's because the big mean OO mafia hyped OO and they're just bad for doing that.
If we'ld had blogs 20 years ago, that would have been "how procedural programming almost destroyed my business".
Next year, it'll be "how functional programming almost destroyed my business". the year after, I'm sure there'll be something else.
Perhaps it could even be "how listening to other people and their excessive hype almost destroyed my business" and that's good because it's being fair to the technology.
One thing we can be sure of, however, is that it would be an outright lie to say something like "how I almost destroyed my business" because it's always someone else's fault.
Not sure procedural destroyed any businesses. I can think of practically no cases where procedural and structured programming aren't better than the old way. The only case is goto for errors but that is because of a lack of exceptions in C.
OTOH OOP is not always the right thing. It is something that is extremely beneficial in many cases but there are some where you wouldn't use it at all. Most predominantly OOP apps even have extensive procedural code because that was the right thing in that area. Not to mention that a huge section of OOP apps are actually functional applications that use objects as verbose closures and first class functions.
Simply put it isn't the same degree of an improvement over the change to procedural and isn't as generally useful. How many languages today do not use lexically scoped procedures? Methods simply being such a procedure with an implicit first argument.
I think that if a programmer who only really understood GOTO were forced to use procedures they could royally screw up the project by trying to emulate GOTO with procedures.
With respect to OOP versus procedural: I'd say that either OOP or functional is a big step up from procedural. Either OOP or functional allow you to combine data and code into a single package.
While I think your statement is a little harsh, I agree with the sentiment. (I'm the submitter).
However, your statement is akin to saying "fat people are fat because they eat too much ... all you have to do is burn more calories than they eat." Another example of such a statement is "people in debt are just stupid ... all they have to do is spend less than you earn."
Both statements are true*, but they miss the same introspection the author misses.
It is as if I were to blame someone who doesn't understand what I'm saying (you, in this instance): I'd do better to learn what I'm doing wrong in trying to make you understand than just saying you're an idiot.
That's what I'm after here when I submit an item for discussion.
*: Fat people can be fat because of biological reasons that go above and beyond just eating too much, but I think the point is understood.
Sorry to hear about your weight problem.
[deleted]
I guess the point is also that you don't need all the abstractions all the time. This is what I hate about Java: it forces you to use objects and the community is all behind big and complex solutions where much simpler ways would do the work just as well or even better.
You can chose not to use Java for the job if it doesn't fit. I fail to understand what you're force to do anything since it's obvious that Java doesn't fit for what you want to do.
If your company or clients are totally into Java, you have no other choice.
Wait, your argument will be: so get other clients and company. True, that's exactly what I'm doing.