Archive for the ‘Coding’ Category
In 2001 I created a PHP 4 web application framework from scratch as the backbone of a sophisticated application. Back then frameworks weren’t cool. Smarty templates were the hotness.
My framework had URL routing, templates with a capable templating syntax similar to mustache, loosely coupled and tightly cohesive object-oriented design, an elegant way to access the database without dumbing it down, and nicely separated business logic and presentation layers — among many other nice things you find in good frameworks. As the application grew more and more complex, the framework continued to serve well with only occasional enhancements.
I mention this because it illustrates that I’ve been aware of how to design maintainable systems for a long time. But the so-called MVC paradigm (model, view, controller) has never made sense to me.
The design goals make sense. See above. It’s just that I find MVC itself — the abstraction and implementation of those goals — to be unhelpful at best, on a day I’m being charitable. On a day I’m telling it like it is, I’ll just bluntly say MVC is the most confusing pile of acronym bulls**t I can think of.
Tell me, without knowing what MVC is, what would you guess the model represents? Controller? View? It would be bad enough if these were abstract terms like “node” or “resource,” but they’re not abstract. They hint at meaning, and then you discover that MVC doesn’t align with the hinted-at meaning. Instead, the M, V, and C represent concepts that are vague and hard to understand, and are kind of a stretch to mentally fit with the terms. This is worse than abstract, it’s misleading. It’s like bait-and-switch for someone who’s trying to grasp what it means.
I don’t know where MVC came from and I’m sure I won’t change my mind if I find out. I have a hard time believing that I’m the only one who wishes someone had formed a committee to discuss what kind of names to represent the concepts. Especially since there are so many frameworks that abstract things slightly differently, because MVC apparently doesn’t suit their designers either, and thus it’s necessary to explain the relationship between Framework X’s view of the world, and how that loosely maps to the MVC view of the world. It becomes a sloppy comparison to a sloppy analogy.
Even more fun: some folks try to invent an MVC framework, like the original ASP.NET, and “get it wrong,” to disdainful criticism. Then they have to reinvent it, sometimes several times.
It’s kind of like the OSI 7-layer model, which everyone agrees doesn’t actually represent modern networking technology stacks cleanly, and yet everyone talks about the OSI layers. There’s a clean way to think about networking layers, but the OSI model ain’t it. Or NoSQL — the most unhelpful, undescriptive name for an … amorphous category of technologies or worldviews or design patterns or whatever… ever.
The lesson: great concepts that teach great truths, and could result in great advances in engineering due to a common mental model around which other things can be built, can be sidetracked by slapping an ill-fitting monicker or set of analogies on them. And sometimes we never seem to get another chance. NoSQL believers can’t seem to think of anything better than NoSQL as a name (and neither can I, as much as I deplore the NoSQL name). We’re stuck.
I’m sure my strong opinions on this are a) somewhat ignorant and b) not shared by everyone. Discuss! :-)
 Yes, I’m aware that awful things come from committees, like SQL. But I have faith that it would have been better than MVC.
I’m scheduled to talk about Go a couple times in the upcoming weeks.
The first is May 4th in Arlington at A Day Of Foster.ly. I’ll be a participant in a panel titled Add To Your Programming Toolkit: Languages You Should Know About (Erlang, Clojure, R, Go, etc…). I’m talking about Go, naturally.
The second May 7th is at my local technology guild, the Neon Guild. I’m going to be giving a “gentle introduction” to Go. I’ve been programming in Go for less than a year, so my first impressions are still fresh. If you are in the Charlottesville area and you haven’t been to a Neon Guild meeting, do yourself a favor and show up. It’s free and no RSVP is required. Description:
It seems that every time I tell someone we’ve chosen Go as our primary language at VividCortex, they respond with something like “I’ve heard about Go! Neat! What is it like? Why did you choose it? Are you happy with it?” The answer is that Go is a fascinating language that’s working great for us. After many years of programming in everything from C to Java to C# to Perl to LISP to Shell, I’m pretty much in love with Go. There are particular reasons I chose it for our special use case, but beyond just niche considerations, it’s working great as a general-purpose, high-performance, very productive systems language. I’ll try to contain my enthusiasm and tell a story about evaluating it, learning it, and then learning it more deeply.
I hope to see you at one of these events. If you see me, wave and introduce yourself, and give me a business card so I can
stalk connect with you on LinkedIn!
Last night at the Golang-DC meetup I spoke about building (MySQL) database applications with Go. The meetup was well attended and people were very enthusiastic about Go. I spent a few minutes talking about Go in general, how VividCortex uses Go (we’ve built our agents, API servers, and all backend processes with Go), why we like it, some of the nice things it enables like making it easy to build very resilient programs, and then I gave the presentation, which I’ve embedded below.
Afterwards the discussion ranged to a lot of related topics. This was the best part of the evening for me. There were really great questions on a variety of topics, and insightful answers from everyone.