1. May 13th, 2007

    The inevitable migration of framework coders

    This post spurred an e-mail exchange with Giles. If I get his conclusions right, he’s ranting about the imminent en masse immigartion of framework coders over to Rails. In his opinion, a problem with the Rails culture. In my opinion, an inevitable side effect of being widespread.

    You can tell a framework reached its tipping point when it’s talked about by skilled developers, but they’re outnumbered by framework coders.

    Framework coders. You’ve seen them before. You walk by their desk and admire the hefty collection of development books stack on their shelves. They cover just about every topic worth of attention, from SQL to XML, from building Web pages to RIA, from language to protocols. Yet one thing tells them apart. Each time you walk by their desk, you notice these books are stacked nicely on the shelve. There’s only one book on their desk lying flat open to some random page. The Framework Book.

    Framework coders are top to bottom problem solvers. When they have a problem to solve, they attack it by starting from the top of the stack. That framework book that’s open flat on their desk. Some framework start there before attacking their shelve for deeper answers. Some framework coders go so far as to place an embargo on all but The Framework Book.

    In some respects, framework coders are just like every one else. We all have an infinite capacity for learning and retaining information. Where they differ is in the way they make up for that humane deficiency.

    Let me tell you a secret. When I first started working with Ruby, all that meta-programming stuff just flew by me. I couldn’t understand exactly how class << self works, or how to use it properly. I didn’t even notice method_missing until way later. And to this day, I’m still confused on the difference between include and extend and how they affect constants.

    So when it came time to speed things up and invent a little DSL, I had to pay the Pickaxe book a second read. And a third read. And some frequent visits since then. And that’s not the only example. I still refer to the SQL docs, the HTTP spec, lookup the finer points of HTML. I can only remember so much.

    Of course, if I was a framework coder, none of that would happen. My first read through the Pickaxe book would be the last one. The week intensive learning of SQL would have been my last experience with it. What I learned once would carry me through the rest of my career, and I would never been the wiser.

    Framework coders are efficient developers. You can’t say they’re not. They optimize their time by getting the code to just work. A framework coder would be content writing this:

    Order.find(:all, :condition=>"closed").each { |order| order.destroy }

    Efficient coding, one statement to remove not just the orders, but cascade and eliminate all the related dependencies from the database. It’s also a very wasteful use of CPU and I/O, performing N statements (deletes) over M tables (relations). But to know that you need to understand the resulting SQL and how databases work. And it’s not in The Framework Book.

    Framework coders are bound by the framework. Truth be told, none of that would be a problem if the framework implemented an efficient cascading delete method. But frameworks are never perfect. The moment they get to do one thing for you, you’re already moving to bigger and more complex applications. A framework is never good enough, you always need more than it provides.

    It’s no wonder framework coders flock towards frameworks that promise the one efficiency they care about most: writing less code. And it’s no surprise Rails is a major attraction for framework coders that bring with them their lack of skills and bad practices. Just like any other framework before it, just like the framework that saved them from developing those skills, that promoted those bad practices.

    But there’s one point where I disagree with Giles. No framework will ever develop skills in those who refuse to learn and apply them. And no framework will promote the right choices in those who refuse to understand the consequences of their actions.

    Framework coders do not understand the affects of their code. A good framework can give you the tools necessary to write efficient SQL, to use SQL wisely, to produce clean HTML. But that same framework will also let you write disk thrashing SQL, worse than binary XML, and GeoCity quality HTML. Frameworks do not distinguish between good and bad.

    To choose one or the other, you need to understand the result of the choices you’re about to make. You need to describe the SQL, inspect the XML, qualify the HTML. You need to play judge to the results of your actions, you need to understand the bottom of the stack. It’s a dark place that framework coders refuse the enter. They just write code and hope for the best.

    Framework coders are forever bound by the framework, forever using it to random effect. Frameworks come and go, but the unskills of the framework coder endures. Being critical of framework coders, teaches us nothing new about the framework, the language or the platform. All that matters is whether or not the framework helps you manifest the skills you already have, and plan to keep on developing.

    1. May 13th, 2007

      Ewout ter Haar

      Well yes, but why stop at SQL, HTML and XML? Why not roll your own mark-up language, implement your own query language or write everything in assembly? What I mean is: from your argument it is not clear how frame-work coders differ from users of higher level languages. I assume that you don’t want to imply that ruby coders should understand the solid state physics of transistors (”… the bottom of the stack. It’s a dark place that framework coders refuse the enter”)

      (your openid login did not work for me. I use ewout.org which delegates to myopenid.com)

    2. May 13th, 2007

      Assaf

      Ewout,

      Framework coders don’t go beyond the framework. They’ll never look at SQL produced by the framework and try to figure out if it’s using an index or running a full table scan. As far as they know, code starts and ends at the framework.

      Other developers understand that the framework generates SQL, what it looks like, and that sometimes you have to grab these statements from the log and describe them in the SQL console to see how efficient they are.

      And the same analogy for view sourcing your HTML, or reading the generated XML, or checking out the cache control HTTP response headers, just to make sure what you’re telling the framework to do is what you want to happen.

      Separately, I’ll have to see if there’s an upgade for the OpenID plugin that will fix the delegate issue,

    3. May 14th, 2007

      toolmantim

      I’ve written a wee writeup about Giles’ rant

    4. May 14th, 2007

      Nate Kohari

      If you replace the word “framework coder” with “terrible developer” I would agree with this article.

      Although, the inverse argument can be made as well — developers that insist on “rolling their own” each time they work on a project are just as bad as developers that don’t understand the nitty gritty. Arguably, they’re worse — because if you stumble across that removal code snippet, you can always refactor it to improve performance. If someone writes their own flavor of strings to squeeze out that last drop of efficiency, your project is married to it forever.

      It’s definitely important that developers understand mid-level concepts like SQL, and even low-level concepts like floating point arithmetic, memory management, the stack and the heap, and even the ALU and how it processes instructions. That doesn’t mean that they should be thinking about it every time they write a line of code. That’s why we write in fancy languages like C#, Java, Python, and Ruby — so we don’t have to worry about things like that all the time. Same thing goes for frameworks.

    5. May 14th, 2007

      fromvega

      You have a good point. I always thought that you shouldn’t keep tied to a framework, that you should always develop your skills first then use a framework if you feel that it will indeed help you. Whenever you have a change to learn at base levels (or just take a look) up and down the abstraction layers to the electronic level, as said in the first comment, you will have a wider understanding of the system as a whole and will be able to create a better software. I use mostly PHP for my web projects and I was always reluctant to adopt a framework since you never know when the developers will drop support to it, when they will fix bugs and so on. This sittuation changed with Zend Framework. I decided to give it a try since it’s being supported by the PHP company itself. Another flaw of frameworks in my opinion is that they provide just an alternative way to code the underlying language, like for instance the Active Record pattern. Not that it isn’t good, but for instance, if you need to make a simple select query with ‘WHERE’, ‘ORDER BY’ and ‘LIMIT’ you still need to write them and pass as the arguments to wherever method you are using. If you want to make a join or use foreing keys you would need to map the database relationships into the framework instead of writing a simple SQL query. Frameworks have they goal but sometimes (or a lot of times) it’s better to stick with the underlying implementations, even more if you care about performance.

    6. May 14th, 2007

      Giles Bowkett

      Just for perspective, if I can quote something from the e-mail correspondence, where you said

      I’m willing to bet a year’s worth of salary that the Next Big Language will bring with it a lot of bad programmers and those will bring their bad habits with them.

      I wouldn’t want to make that bet against you! I’m not actually in disagreement with that; I just think that I’m still going to call it a Rails issue rather than a larger thing, because the larger thing is really difficult to get a handle on.

      Also, Tim’s writeup on my alleged “rant” does nail your :conditions concern, turns out to be a nonissue.

      However, I think Tim took the criticism entirely personally, it certainly wasn’t intended as a rant, and the whole thing could be a lame-ass flamewar unless it’s treated with diplomacy. I definitely should have written that post differently.

    7. May 14th, 2007

      Franck

      I would agree with the first comment that working with “abstract” languages is not a problem… unless you have performance issues. Then it could be better to understand how things are working at low level.

    8. May 15th, 2007

      toretore

      This is all true, but you (plural) could have chosen a different example to illustrate your points. I see nothing wrong with Tim’s piece of code, except for the SQL bit, but it wasn’t meant as an example of how to do SQL well but rather how to overwrite (or define for the first time, really) dynamic finders in AR. When someone comes up with yet another Ajax scaffolding plugin with sortable columns, funny widgets and transition effects, by all means unleash your fury on them ;)

    9. May 17th, 2007

      Giles Bowkett

      Heh. Actually I linked to the Ajax scaffold thing the other day. I actually like it. Not so much as a thing to use, but as an example that you can in fact build your own scaffolding on a per-project basis and might be happier with it if you do.

      Wasn’t meant to be a barrage of fury but I’m definitely going to be more diplomatic next time.

      Anyhoo - on the whole topic of coding within a framework versus understanding it, I think everybody should read “Code Generation In Action.” It’s awesome. The guy’s like, OK, you’ve got to build a J2EE enterprise app with EJB. The DB has 150 tables, so you’re going to need 150 beans, that’s 7 files per bean (that really is how EJB works), so, let’s see, 150 * 7 = 1,050, so that means we’ve got to write 1,050 files, so, if you do it by hand, that’ll take three years. So, let’s write something in Ruby to autogenerate every bean and all the affiliated files for each bean, that’ll take maybe a week, maybe a few days. Boom, problem solved. In fact it even makes using a hefty framework like EJB seem relatively reasonable, as long as you’re writing Ruby to write Java for you, instead of actually writing Java, because, you know, who would write Java by hand when it’s so much quicker to write Ruby which writes Java for you?

      He’s basically trapped in a framework Java project, and instead of being like, oh well, better take my lumps and code to the framework like I’m supposed to, he’s like, no no no, that’s too much work, frameworks are easy enough to code to that I can write a program to do it for me. It’s funny too because his attitude is so nonchalant, he’s like, obviously, since we’re using a Java framework, we could write Java, but that would be a waste of time. It’s such a kickass, cowboy attitude, but the book has this incredibly dry, serious delivery, with UML diagrams and everything, like a standard “enterprise Java” book which just happens to casually mention that coding Java is basically a waste of time.

      Anyway, reason I bring it up, if you’re not a framework coder, but you’re on a framework project, this is one way to just totally go beyond the limitations of framework coding.

    10. May 17th, 2007

      Bill de hOra

      Phil Greenspun: “This is kind of thing that we teach our students at MIT: come up with a machine-readable specification language and write a program to generate the programs that run the site. See http://photo.net/teaching/psets/ps4/ps4.adp for an example.”

      Its on! Let’s take some chunks out of DSL blub coders too, cos they never think about semantics, uniform notation or intermediate parse trees.

    Your comment, here ⇓

    Or using OpenID