A colleague at my company distributed a couple of links on MUD -- "A BIG BALL OF MUD is haphazardly structured, sprawling, sloppy, duct-tape and bailing wire, spaghetti code jungle." from A Big Ball of Mud.
I never liked chaining (object methods end-to-end, ad nausem) because it made me feel stupid... It always came off as the "cool" thing at the expense, to me, of clarity. It also felt like a side-effect of IDEs where you just keep getting a drop-down pick list of methods once you complete the previous method name. I know I'm ridiculously blue collar about using vi instead, but what I like about it (being the absence of an IDE) is that it forces you to become more knowledgeable about the object/class definitions you're referencing. You know at some point you're going to have to track down a bug and wouldn't it be nice if you've already explored that deeper code, often written by somebody else. It gives you the extra layer of perspective you need when bug-chasing...
Yes, architectures are beginning to feel commoditized. But I like that. It's like design patterns. When Microsoft came out with C# it pissed me off, big time, as a rip-off of my beloved Java. But then I realized that the favor MS did for all of us was to raise the conversation to the next level of design patterns where the implementation details became less important. My guess is that was not MS's intent, but I believe it was a favorable consequence.
Anther advantage (or consequence) of commoditization is that these architectures are beginning to feel canned and the tools that support them are like-wise starting to feel that way, as they continue to mimic each other... Grails-Rails... does it really matter other than some business considerations?
But I have become a believer in the programming-by-convention. Yes, it goes overboard when you realize so many methods have been automatically created (views, controllers, services, session variables, etc.). But at least there's a higher level of "local standardization" that anybody who dives into the project can expect. I used to like thinner, start-from-scratch architectures... but it's so incredibly silly to have to re-think how to track session, how to send email, how to configure security, how to do things you've done a few hundred times over the past 15 years.
How's that for a preach-y entry?
I'm moving in the opposite directions:
ReplyDeleteI get to liking chaining more and more in any one object family/API (because of fluidity yielding a more readable bit of code, more DSL-ish); I agree that using chaining across APIs violates the Law of Demeter and makes for bad coupling effects.
I got enamored of grails/rails conventions until I discovered I couldn't begin to keep all the conventions in my head in my head! (And I got negligible help from IDEs, or vim) ... on that fron, I'm watching Spring Roo evolve, I have great hopes it will hit the sweet spot...
Always tradeoffs, eh? And always "steak tomorrow ..."