Skip to content

The Agnostic Coder

Transcending the art of coding

Archive

Tag: frameworks

Hmmm… well…. what to say, except “I was wrong”. At least from a certain view point ;)

Having started some new projects from scratch I decided to give up and use one of the many available web frameworks (Perl/Catalyst MVC). And, well, it wasn’t as bad as I remember it being last time I did it. Although to be fair I did take over those projects part way through their development, and not have much time to learn the underlying frameworks before trying to complete the project on time and to spec. Anyway, that’s a poor excuse for not being objective enough in a previous post and declaring (rather dramatically) that all frameworks suck. It’s not true. Only some of them do (I’m looking at you Struts). Yeah, yeah, I’m biased against Java, so what?! I was forced into using it at work to support a project of a guy who left and did the worst job I’ve ever seen. Mostly by using EJBs to talk back to the same server to get data that could easily have been retrieved via sql.  Anyway, I’m floating off topic again.

MVC frameworks (and frameworks in general) do help save development time. Now that I’ve finally got my head around Catalyst (to some degree) and CDBI (to a greater degree) than I previously had, I can easily see how this is going to save me a lot of time on future projects. Granted the initial install (either via CPAN or other means) can be time consuming, but it’s a worthy one.

I’ve also just come across a nice comparison of frameworks (although it is over 2 years old so bear that in mind). Having read through the article and studied the graphs and data, I suddenly though, “Oh my God! I should have put that time into brushing up on Python and Django”. But having read through the comments, I realised my initial reaction was (one again) over the top. One particular comment struck a chord. The results in the article only show the finaly speed, and only in a limited scope (FastCGI), and also for a limited page build. A static page served via the frameworks is going to be less demanding than a dynamic page. And some frameworks are just always going to be faster. But what matters most (to me) is how easy it is to build a new page, or new functionality, or access a new database, not how quick the end app runs (although that does matter of course), but at the end of the day, the system admins can always help by putting my app on a faster server, or load balancing it, or adding better cacheing. If I can push a new app out the door in 30 days instead of 60 days, just by using a framwork, then I’m going to damn well do it. Speed is relative and really depends on your viewpoint.

We all want our apps to be the fastest. But development time, and correspondingly maintenance time and effort matter to. And at the end of the day, I know Perl, I’ve been using it for 12 years. I don’t claim to know everything about it, and I know I have a long way to go to learn everything I need to about Catalyst. So it doesn’t matter to me if Catalyst is slower to run on some random test, while I do appreciate the guys efforts to test and document the framework results, what matters is that I can build something quickly and effortlessly. At the end of the day that’s what frameworks are for, making my life easier…

By framework I mean the MVC crud (and I don’t mean crud as in MVC CRUD either), the stuff that other people spend ages writing that apparently speeds up your development process by a factor of infinity, but only until a) you want to write something that the framework doesn’t natively do, or b) you have a bug, and you can’t find it in your code and you suspect the framework, but hey why would the framework have a bug it’s being used by millions of people all over the world, surely?!, or c) well I can’t think of another reason but I’m sure there is one.

MVC frameworks are supposed to separate your logic, database, and purdy html code so that the poor developer(s) don’t get confused and start writing database queries inside html, or heaven forbid write anything where the framework designer said it shouldn’t be written. Godly delusions, that’s probably what leads people to write frameworks. Why would I want to use your 500,000 line framework when I can write my application in 500 lines, and make it a) work, and b) be quick, and c) scale it up without have to put the whole crudding framework on again and make sure I’ve got all of the 400+ dependancies installed and at the correct version?

Bah, just let me code.