Skip

Riding the Waves
February 29, 2008 1:14 PM   Subscribe

Riding the Waves of interest in MVC web frameworks such as Rails, Django, TurboGears, and Cake, comes the latest entrant: Ruby Waves. Interesting features include request lambdas, hot patchable, nestable templates, app reusability, and decoupled controller/view. Is the proliferation of MVC projects helping to push innovation forward? Or pointlessly reinventing the wheel? (via RubyInside)
posted by nakedcodemonkey (39 comments total) 7 users marked this as a favorite

 
Is the proliferation of MVC projects helping to push innovation forward? Or pointlessly reinventing the wheel?

More like they're creating a generation of "web programmers" who don't actually know how to, you know, program. But that's not my field anymore, so it doesn't affect me. Create "frameworks" so a Ukrainian college student can learn them in a month and do your job for $9/hr, I don't care.
posted by DecemberBoy at 1:43 PM on February 29, 2008


Is the proliferation of MVC projects helping to push innovation forward? Or pointlessly reinventing the wheel?

Maybe I'm just showing my age, but whenever someone comes up with some helpful new way to make programming simpler or more efficient these days my instant reaction is "Christ, not more shit".

I dunno, a little while ago I took some time out of site developement to do some over stuff, and it seemed like when i came back everyone had gone crazy mad keen for patterns, which I new very little all about. After a few embarassing nonanswers in interviews I went out and read up on them, and they are indeed fairly cool, and knowing that stuff helped with further interviews, but did any of that actually help with the nitty gritty of building websites? Maybe a little, but not all that much at all, really, and TBH most of it is a little over the top for your avergae site. Maybe if I were more of an aplication programmer.

The next bog thing in my world is generics. Which are again quite cool, but I think fall into the same category.
posted by Artw at 1:55 PM on February 29, 2008


Data point: Rafe Colburn's My misbehaving Rails application.
posted by tommasz at 2:14 PM on February 29, 2008


DecemberBoy, clearly you don't care.
posted by chunking express at 2:17 PM on February 29, 2008 [1 favorite]


Using a fancy new toolkit or framework won't make your complex, sprawling project any less complex or sprawling. Coding is generally the simplest part of any project. Defining the problem in detail is the hard part.

Let me put it another way: whether you use PowerPoint or a sharpie and transparencies isn't going to make a significant difference in the quality of your presentation, or even how long it takes to prepare it.

I tend to avoid frameworks because it's much easier for me to diagnose my own problems and errors than someone else's.
posted by phooky at 2:43 PM on February 29, 2008


I'm been tasked to develop an "awesome" web app that runs "Rails" and the more I get into it the more I think "why the fuck do pageviews have to be objects?"

And the only thing I can come up with is systems programmers or "serious" applications programmers incessently belittled web programmers until finally the web developers said "fuck it, let's build some complicated abstraction layers that will make it less complicated, as a premise, but really more complicated so the C/Java fuckers will stay off our backs and/or my CS degree from Brown was really expensive" and so now web monkeys are like "check out my serious web app" that's shimmied together with more data models than a satellite mapping app.

I don't blame them, the future is cloud computing. But all I want to do is modify my shopping cart.
posted by plexi at 2:49 PM on February 29, 2008 [5 favorites]


I liked the early versions of Rails: they did enough of the grunt work that focusing on the pleasurable bits of coding was genuinely fun, and the speed was noticeable.

Then they started believing their hype, and it all became a mess. Did I care if I was especially RESTful? No, but it was everywhere;rammed. This is fine, if you can ignore it, but they also decided that backwards compatibility was a burden, so APIs would up and change at will, partly to accomodate it, mostly to allow for the latest passing butterfly. All of this would be OK, if you had oodles of spare time just to keep up with the progress of the framework, but they even made that hard: changelogs aren't documentation, and it was sometimes impossible to parse out the changes if you hadn't been part of them. But hey, you could buy another edition of their books ...

Backwards compatibility is a burden, but it is also a blessing: it forces you to edit. If you can't have New Shiny Toy without burdening everyone, you have to decide how much it is worth. When you can write off the editing process, you get bloated, ugly cruft. And that's where Rails is heading for me.

Waves has lambdas? Great! But I'd much, much rather have a framework that was committed to stability above all else, and let me work on my own problems; not the ones they make for me. I guess I'm about to look into Ramaze, which promises some of this.
posted by bonaldi at 2:52 PM on February 29, 2008 [2 favorites]


DecemberBoy: I completely disagree with that statement.

MVC frameworks allow you to take your mind off some of the tediousness that is the vast majority of programming. For example, I understand how sockets work, and how HTTP request/response headers work, why do I need to code interfaces to them again and again? Why do I have to reinvent another authentication mechanism? Why do I have to manually make every single SQL statement in my app? These are solved problems that hold back innovation because you have to deal with the same things time and time again. And before anyone says 'special cases', in two lines of code I can drop to a SQL cursor if need be.

My current foray into the web app field was done with python and django in less then 700 lines of code, if you don't count templates (total with templates and JS, ~2500). I made a pretty, high level app that is stable and speedy, with minimal coding, minimal headaches, and a code base I can hold entirely in my head. It is a joy to code, and something I do willingly, even after a full day of work. If I didn't have django, if I was still doing PHP, I wouldn't of done it. (link is in profile if you're interested, i wont spam here)
posted by Mach5 at 2:54 PM on February 29, 2008 [1 favorite]


These frameworks strike me as good for pretty much one thing: rapid application development. It's been a while since I've done backend web programming, but recently I needed to prototype some web apps. I tried RoR, Django, Cake and Grails. Each has its up and downs (I ended up using Grails), but I'm not sure I'd like to use these for anything other than RAD. Too much "magic" going on for me.
posted by ryoshu at 3:27 PM on February 29, 2008 [1 favorite]


I use Catalyst at work, and for most of my side projects. Mostly it replicates the functionality of the ad-hoc framework I'd been using before, but in a smarter tighter package, so I get code that's a little easier to understand and maintain. When I hand the project off to someone else to work on, the fact that I use a bunch of standard concepts (patterns even) makes it easy for them to understand why I've made the implementation decisions that I did (I know, you're all shocked that a perl programmer is talking about desiring maintainability and readability).

I think that like template libraries, every experienced programmer has probably written a half-assed MVC framework or three. And like template libraries, most people realize that having one (ok, a few) good, fast, general purpose framework rather than reinventing the wheel, badly, each time is desirable. As with any abstraction layer, poor programmers will use it as an excuse for cargo cult programming and magical thinking (and some of the frameworks are worse for supporting this than others) but that doesn't make it any less useful as a way of managing complexity and communicating ideas with our peers. Primarily that's what MVC is about, whatever the language or framework you choose. Everything else is syntactic sugar.
posted by mock at 3:51 PM on February 29, 2008 [1 favorite]


If:
  N technologies try to do X AND
  N >= 2

Then:
  At least N-1 technologies failed to do X

If any of them worked well, people would stop trying to do better. If N is large, X is probably hard or ill-defined. It isn't necessarily bad there's a new framework but that doesn't mean people should get excited either.
posted by chairface at 4:04 PM on February 29, 2008


Hmm, that request lambdas form looks quite nice actually. I may use this for the next trivial-but-web-accessible project I decide to begin and abandon halfway through.
posted by Skorgu at 4:36 PM on February 29, 2008


Is the proliferation of MVC projects helping to push innovation forward? Or pointlessly reinventing the wheel?

The former. Face it: web development is somehow boring and rip-snortingly difficult at the same time. Each new web development toolkit brings at least one new good idea to the party and moves the state-of-the-art forward. Not a lot, but forward.

That, and writing web frameworks is fun.
posted by jacobian at 5:03 PM on February 29, 2008 [1 favorite]


This month I was tasked with updating a site which... well, let me put it like this. On every page load a database row was refreshed in a unique way:

$q = "DELETE FROM lastseen where ip = '$REMOTE_ADDR'";
$q = "INSERT INTO lastseen SET ip = '$REMOTE_ADDR', when = FROM_UNIXTIME('" . time('now') . "')";

Seven errors in two lines, if you include the lack of an index on the VARCHAR ip column. If the developer that built this... this thing had been constrained by a framework, some of the common tasks (data sanitization, date handling, a lot of the SQL, etc) would have been taken out of his hands and I might not have thrown away an entire codebase and started from scratch.

That's the true value of frameworks - they force everyone to work at a higher level of abstraction, where all the cutlery is made of plastic and they can't hurt themselves or any passing maintenance coders (eg me).

Patterns should have had the same effect, but unfortunately they're voluntary and you have to care about your craft somewhat to use them. Frameworks are patterns made flesh, and it's a lot easier to decree the use of a framework than a vocabulary.

Of course, the strength of frameworks is also their weakness - just as they pull bad ideas up to their level, they also drag good ideas down to their level. For example I prefer PAC over MVC, but I'm willing to take the hit of using a non-optimal solution if we gain consistency.
posted by Leon at 5:31 PM on February 29, 2008


MVC frameworks allow you to take your mind off some of the tediousness that is the vast majority of programming. For example, I understand how sockets work, and how HTTP request/response headers work, why do I need to code interfaces to them again and again? Why do I have to reinvent another authentication mechanism?

That, BTW, is an argument for libraries, not frameworks. Two different things.
posted by Leon at 5:36 PM on February 29, 2008


Leon: True, but all the frameworks I know of leverage certain libraries together to make a meta-library of sorts. Django uses SQLObject on the backend with its own templating library. TurboGears uses Mochikit, Kid, CherryPy, and SQLObject. A framework is a library of libraries, and a specified coding pattern to glue them together.
posted by Mach5 at 6:17 PM on February 29, 2008


I understand how sockets work, and how HTTP request/response headers work, why do I need to code interfaces to them again and again?

Please, you don't need MVC for this. Go to your command line and type:

$ python -m SimpleHTTPServer

and you are now serving the current directory on port 8080 as HTTP. (btw, this is really handy if you just want to transfer a few files from one place to another and you don't have either ftp or scp available...)

Here's the base class SimpleHTTPServer is derived from. It handles all of that for you.

The same sort of thing is built in to Perl, Ruby, Java, any other high-level language you like these days.

I also find all of these MVC-frameworks to be seductive but ultimately bogus for what I do. They don't save me much work; you spend too much time worshiping the framework. It just always seems to be the case that the one thing you can't do easily is the one thing that's central to your business logic.

These days, I want all the parts to be completely separated - so I can use exactly the same code to do real-time stuff, reporting, testing. In my current project, I'm using Clearsilver templates to represent the front end, and simply sending around packets of named data in Hierarchical Data Format to fill them.

The big advantage for me is that as long as the template and the data get together, we don't care how the data is generated, which means that I can unit test everything by stubbing out various parts. I frankly have a lot of trouble in believing in my own code (or anyone else's) unless there are thorough automated tests.

We had a pretty heated argument once before here as to whether unit tests are necessary - it's been over a year, I've written God knows how much code, mostly unit tested and I think they're more essential than ever. Regression tests are helpful to catch gross errors, but unit tests are essential to make sure that each component is well-specified. I can't remember one time that I wrote a unit test that didn't catch some sort of aberrant behaviour from my code, even code that supposedly worked. (Mostly edge cases - but edge cases will get you sooner or later; or worse, they'll catch some later maintainer of your code who doesn't have the clear vision of your code you do.)

This means that we can write code now for daily reports, and then later to go a real-time backend and most of the code will not change at all. (We can't just pop up real-time reports on top of some database because of the extreme size of the underlying data.)

Shopping carts are quite different of course and these "rails" toolkits are pretty good at those.
posted by lupus_yonderboy at 6:47 PM on February 29, 2008 [3 favorites]


You guys should check out Code Igniter (PHP). It's a lightweight MVC framework with the difference being that no magic goes on. It doesn't get in the way and it's a joy to use.

A good MVC framework simply redirects requests to controllers, somehow partitions views and allows simply creation of some sort of models. Other features, like Rail's Active Records, are unnecessary for MVC but can be convenient in moderation. But since MVC seems to be the best way to organize code when writing web applications, the choice is to either recreate it from scratch or use a framework. Why not use a framework?


But that's not my field anymore, so it doesn't affect me. Create "frameworks" so a Ukrainian college student can learn them in a month and do your job for $9/hr, I don't care.

This might be true if only the Ukrainian college student could use the framework. You can use it too, so you're still competing on equal footing. Your argument could be make about every advancement in programming we've had in the last 40 years ("C will let people who don't know assembly write programs! We'll be out of a job!").
posted by null terminated at 7:12 PM on February 29, 2008


Also, Rails is not representative of other MVC frameworks. MVC is the most efficient way to build a website (if there's a better alternative I really would like to hear about it), and there's nothing wrong with using a program that simplifies the repetitive aspects of development.

The existence of multiple frameworks that fall under the same broad category does not imply that they're all failures. Frameworks have different strengths and weaknesses. These frameworks also do not threaten your very existence, as some of the above frameworks seem to imply. These frameworks are mainly open source projects that were created because a developer realized a specific coding task was either taking up too much time or too much space. He abstracted it and released it in hopes that someone else would find it useful. That's all it is--there's no conspiracy.

I'm been tasked to develop an "awesome" web app that runs "Rails" and the more I get into it the more I think "why the fuck do pageviews have to be objects?"

Who represents page views as objects? How do you suggest building large web apps without using some variant of MVC (this is not rhetorical)?

On non-preview, basically what mock said above.
posted by null terminated at 7:21 PM on February 29, 2008


*the above comments seem to imply
posted by null terminated at 7:22 PM on February 29, 2008


You guys should check out Code Igniter (PHP). It's a lightweight MVC framework with the difference being that no magic goes on.

CI uses output buffering to include page fragments. It's not a sensible approach.

MVC is the most efficient way to build a website (if there's a better alternative I really would like to hear about it)

PAC, for a start. VC sans M (it's overkill 95% of the time). But they all boil down to one form of n-tier architecture or another; they're all variations on Layers.

Hmm. My copy of GoF seems to have gone walkabout. That's odd.
posted by Leon at 7:48 PM on February 29, 2008


Code Igniter (PHP) I'm not a code snob, but PHP is not acceptable for production work.

You can't write tests; there's no mechanism to internationalize; it doesn't even support Unicode; all variables are more or less global; the language itself is very unexpressive and lacks all sorts of nice stuff, and the good stuff is defective (ARG, PHP's "array"s!)

See here and here.

Trust me. If you are intending to write in PHP, call me up. Use Perl, Python, Java, use C# even, but run screaming away from PHP. I spent 9 months working on it once, I swore I'd never use it again.
posted by lupus_yonderboy at 12:16 AM on March 1, 2008


For all of PHP's warts (they are large, bulbous, and varied), it's pretty much perfect for doing what it 's true purpose was — embedding small amounts of code to shove dynamic data into documents in a shared hosting environment. It's leagues better than SSI or CGI for that purpose.

It's the antithesis of all the 'Application Server'-style frameworks written in pre-existing languages like Java, Perl, Lisp, Python, and Ruby. And all those frameworks have lots of administrative overhead, and are a bitch to deal with on shared hosting.

A less-than-bright recently hired CS faculty at my school wanted to teach web programming in a freshman pre-CS program using ASP.net and Access. Incidentally, he doesn't believe there's any value in CS as science, he's an "educator". At my job I maintain nearly all the lab computers on campus — he approached us about making sure the ASP.net + Access combination would work, and we had to struggle not to laugh in his face!

Since we don't even maintain a Windows server to run that bullshit on, we googled PHP + sqlite and had a tutorial working in 10 minutes having never touched it before. I was really surprised just how easy it was.

It's obvious how fucked things start to get when you try to start doing things the clean way, with MVC frameworks and templating engines — PHP is a templating engine! But going hardcore the other way to the application server side is no real solution either.

You'll always have some peanut butter in your chocolate, as THIS PRODUCT WAS MANUFACTURED IN A FACILITY THAT PROCESSES NUTS, INCLUDING PEANUTS
posted by blasdelf at 12:59 AM on March 1, 2008


PHP has its problems, but I still like it.

You can't write tests

I use an MVC framework with a "Test" controller that copies the structure of my db and runs unit tests on all my models.

And I don't think "9. Framework seldom used" and "2. Separation of Presentation from Business Logic" is a valid reason to dislike PHP (especially in a thread about PHP MVC frameworks). Other parts of the article, like "Nor does it by default give you any error message. Instead, it assumes that you wanted a completely random, uninitialised variable." can be easily be avoided by calling "error_reporting (E_ALL);" which should be done by default.
posted by null terminated at 1:22 AM on March 1, 2008


You can't write tests;

I write tests quite happily with SimpleTest. Unicode and a "we-couldn't-screw-this-up-more-if-we-tried" form of namespace are available in PHP6.

A less-than-bright recently hired CS faculty at my school wanted to teach web programming in a freshman pre-CS program using ASP.net and Access. Incidentally, he doesn't believe there's any value in CS as science, he's an "educator".

Neither do you, if you're going to use PHP as a teaching language. You realise that a code monkey pushed down the .NET route is going to earn 30% more than one pushed down the PHP route, right?
posted by Leon at 1:36 AM on March 1, 2008


which should be done by default

Well, there's the root of the problem. Languages shouldn't have config files that completely change their runtime behaviour.
posted by Leon at 1:37 AM on March 1, 2008


Well, there's the root of the problem. Languages shouldn't have config files that completely change their runtime behaviour.

error_reporting(E_ALL); is no different from Perl's "use strict"
posted by null terminated at 1:55 AM on March 1, 2008


not different from/no different than
posted by null terminated at 1:55 AM on March 1, 2008


Neither do you, if you're going to use PHP as a teaching language. You realise that a code monkey pushed down the .NET route is going to earn 30% more than one pushed down the PHP route, right?

Don't look at me that way, it was the least bad option!

The interdisciplinary program in question isn't really aimed at code-monkey production. Also, I think that collective derision has worn down his desire to have his students do any web stuff. His ignoble goal was really to 'diddle with databases'…
posted by blasdelf at 2:27 AM on March 1, 2008


Don't look at me that way

Heh. Sorry, on re-reading that came across as harsh in a way I completely didn't mean. My apologies.
posted by Leon at 2:30 AM on March 1, 2008


error_reporting(E_ALL); is no different from Perl's "use strict"

I meant "error_reporting = E_ALL" and friends in php.ini. You can write code that runs quite happily in one environment, but breaks in spectacular ways in the next. Yes, I agree, in an ideal world the default behaviour of the language would be E_ALL (until the developers change what E_ALL means again, but that's a different rant), but it should be tweaked script-by-script, not globally.

The same goes for register_globals, variables_order, magic_quotes_gpc, safe_mode and all the other stuff that, when flipped, breaks working code. variables_order is a particularly nasty example. There's no possible justification for its existence.
posted by Leon at 2:58 AM on March 1, 2008


PHP is not acceptable for production work.

Someones got to tell Yahoo!
posted by chunking express at 6:12 AM on March 1, 2008 [2 favorites]


null terminated: reate "frameworks" so a Ukrainian college student can learn them in a month and do your job for $9/hr, I don't care.

So frameworks are bad because they lower the barrier for web development and allow people to use them to escape poverty? This is your argument?
posted by signal at 6:14 AM on March 1, 2008 [1 favorite]


I'm all for people writing new frameworks. It's fun and it teaches you what exists below whatever framework you end up using. When I did CS a couple of people wrote new operating systems. I bet it was great experience.

I'm turning back to the idea that PHP is a great language for web development. And no disrespect to Rails, but I'd rather spend 80% of my time coding and 20% installing than the other way round. Yeah - PHP can be a mess, but it doesn't have to be.

If I had one criticism of PHP, I'd like to see a more defined way of splitting the templating stuff away from the stuff that does the hard work.

As for the Microsoft offerings... I believe they're great, and Studio 2005 allows for fast development and deployment, but I find VB.NET a terribly boring language to program in. I'm involved with a minor .NET project at the moment and by the end of the day, I can't wait to go home.
posted by seanyboy at 8:37 AM on March 1, 2008


null terminated: I've started playing around with CodeIgniter myself, partly because my limited PHP skills have left me after years of neglect. I've still got to get the hang of it, but I think for my purposes it's just what I need.
posted by kryptondog at 10:00 AM on March 1, 2008


signal: I was quoting DecemberBoy
posted by null terminated at 12:40 PM on March 1, 2008


VB.net? Crazy. Switch to C#.
posted by Artw at 5:14 PM on March 1, 2008


null terminated: woops, so was I.
posted by signal at 6:02 PM on March 1, 2008


Yeah. I've never got on well with the C derivatives. A month of writing OSI network layers in C pretty much turned me against C, Java and C#.

Give me a toy language that's Turing complete and I'm a lot happier.
posted by seanyboy at 12:57 AM on March 2, 2008


« Older More White House lies...   |   WE DID IT THROUGH TEAMWHURK! Newer »


This thread has been archived and is closed to new comments



Post