53 comments

[ 6.7 ms ] story [ 86.9 ms ] thread
I don't understand why this article is remarkable.

It shouldn't be a grand revelation that there is more to web development than what runs on the server.

Or a developer getting disinterested in the framework he has been using for a while, for that matter. It's pretty common.
This is less about moving on from Rails and more about moving on from building static pages from a database. Lots of web folks have been predicting this. I've been saying for about two years now that the days of serving entire HTML pages from the serverside are numbered. With things like Backbone, I can bring up a Rails app without views and do something pretty awesome. And then it becomes a question as to what Rails offers.

I love Rails. It got me back into web app development in 2005 after nearly burning out. But Rails isn't exactly keeping up and people who need to move on are going to do that.

I just got finished porting an admin panel from rails views to backbone.js and doing anything in backbone.js is a lot more work. Not only that, you still end up using rails views because you probably want to send pre rendered html to the client to minimize their wait time.
Just curious, but did you use a JS templating language? Cos we've been sending json back and pushing it to mustache templates which seem to render pretty quick.
I used underscore templates. Rendering large complex pages is slow. Doing it client side on an iPad is not good.
I'm not sure that is true for even the majority of cases. Remember that most of the web is not applications but simply pages of content server from a database.
But that stuff doesn't need Rails. At all. I'm talking about applications where people do something. The CMS problem is largely solved. Generate static pages from database content.

Combine that with bandwidth caps and you start looking at creative ways to make things work more efficiently. One of those ways is to simply stop sending things down the pipe. Like the repeated layout.

I wouldn't say the CMS problem is 'solved' exactly. Sure, you can install drupal or something but in the majority of cases I still end up building something with a web framework to server out mostly static content (i.e stuff that changes, but not on a second by second basis). Off the shelf CMS is often either underkill or overkill.

There are plenty of ways to make things more efficient without abandoning HTML altogether.

I think you misunderstand. Or perhaps my comment wasn't well stated... Serving staic pages is the solved problem. So is CRUD-based Rails apps. We know how to do that. In that sense, it's solved. We can use Wordpress with Rails, or Radiant, or we can roll our own in half a day.

When you send HTML to people, it should be for reading content. That's its purpose and I don't see that ever going away.

But when you're talking about having them interact with an interface, I don't see much of a reason for developers to continue to treat it like a 1970's terminal screen. We have tools that are getting better all the time.

Building a CRUD CMS is as exciting as watching paint dry to me. Yea people pay for it, but that's usually not the part of the project that's interesting. Doing the same "solved problem" over and over gets old.

And it gets scary, because new stuff is happening.

I think we are in agreement more or less. Building CRUD apps isn't exciting or particularly difficult for the most part, although I have built some pretty huge complex CMS systems for specialist industries that were highly bespoke and integrated with legacy back-end.

You can build applications now using things like <canvas> and Javascript and use almost no HTML to deliver your app over HTTP (although once we get to that point HTTP itself starts to seem like antiquated overhead).

I'm more of a Java than Ruby person but from what I understand Rails is mostly a collection of modules put together (ORM , MVC , Scaffolding etc).

Most of the web apps I build I spend about 70% of the time in the model layer anyway. Even if you were to use a completely different paradigm for front end development the majority of the components that a good framework provides would still be very useful.

This is why I prefer to loosely couple things as much as possible, that way you could in theory decide you wanted to do your entire front end in 3d using OpenGL or something.

I think there is also allot of middle ground between having serving content and having a fully interactive application.

Yeah. That's kinda what this guy was saying in his artle that we're commenting on. He wasn't really "moving on from Rails"... he was leaving the view layer behind. And then evaluating what else he really doens't need.

There's a strong movement among some of the more verteran Rails devs to write abstractions, ensuring that the ap doesn't depend on the framework as much. So as needs change, things can, and probably should, change with it.

In my own experience, using an existing CMS has rarely fulfilled project requirements very well. It's never about just "static pages". You want things like menus and sidebars with specific structure, multi-language support, commenting, search, etc. Then you fight with the existing features and plugins of the CMS and try to bend them to your will.

For instance working with Drupal, my usual procedure was to immediately set up a custom extension, so I could start adding custom features there. I also spent a lot of time learning the filenames of special override templates to use to customize some very small portion of the UI. Sometimes something was impossible without forking an extension or even forking the Drupal core.

Eventually I mostly gave up on the CMS approach and started building websites using frameworks like Rails and Django, which can provide all the features of a CMS as components (gems/apps) which you can use as you wish. I found that this approach almost always suited my development needs much better, because I was no longer "fighting" the CMS.

    I've been saying for about two years now that
    the days of serving entire HTML pages from the
    serverside are numbered.
You'll keep saying that for another two or three years at least.

    With things like Backbone, I can bring up a Rails
    app without views
Backbone-style development sucked when people did it with Microsoft's MFC, it sucked when people did it with Java's Swing and it sucks right now. At least for native graphical interfaces, you have IDEs to help you out with bindings and all that crap.

Rails gives you the possibility of doing progressive enhancements, when you need them. You don't have to build an entire Backbone layer, just for updating a small rectangle on your page, when you can just render a partial in a good old-fashioned way.

    But Rails isn't exactly keeping up
It's just a tool and not all of us need to build GMail. People treat Rails like it's their girlfriend or something.
There's so much here I don't even know where to start.

    At least for native graphical interfaces, you 
    have IDEs to help you out with bindings and all 
    that crap.
Yes, and we had slice and dice dreamweaver. But tons of Rails developers hand-coded their views. You're saying that because it's more work, people won't do it? You're probably right. Thankfully for the super lazy, there are Rails plugins for Backbone that generate a scaffold. And there are other JS frameworks out there besides Backbone. And as more folks work on these problems, maybe we'll get an even better solution. Instead of shaking my head going "it's hard" I'd rather dig in and see what I can do.

    youu don't have to build an entire Backbone layer,
    just for updating a small rectangle on your page.
You said not everyone is building "GMail". Not everyone is buildign CRUD apps anymore either. And for those of us with users that are seeing sites like Facebook and Foursquare and are demanding interactions where the page doesn't refresh, partials become an absolute nightmare. I have many that I work on. It's a mess.

I want to use a framework on the frontend for the same reason I want to use one on the backend... a shared codebase that more people than me understand, that offers some organization and guidelines to follow.

    Rails gives you the possibility of doing progressive
    enhancements, when you need them. 
As an ccessibility proponent, I completely agree that Rails gives us the ability to do progressive enhancement. But it becomes a business question - what percentage uses the low-fi version of the site? Does every project require it? I'll be glad it's there, and doing a non-JS site is in my blood, but reality is that I don't think that's going to be the case in the future.

Thanks to modern screenreaders and a bit of proper coding, we can build apps that are accessible.

It's probably going to be a bit, but I don't want to wait around.

    Instead of shaking my head going "it's hard" 
    I'd rather dig in and see what I can do.
If you're a doer, then good for you. However this development model you're talking about is inherently difficult and better tooling support doesn't help it. You are free to try and fix it however.

Backbone is just a particular example, mentioning other JS frameworks is irrelevant as long as it gets you further away from the simple request/response model. And this is the crux of the problem - most websites and online apps do not need anything more than this simple model, which has served us well and will continue to do so for a long time. And developers felt in love with it because of its simplicity and effectiveness.

So here's my prediction - in 5 years from now, Wikipedia will still be running on top of the current platform (which is universally recognized to be aged and quite shitty), using the same model of interaction with users, but it will still be the most popular and valuable content website from this planet, powered by the biggest database of human knowledge.

    I want to use a framework on the frontend for the 
    same reason I want to use one on the backend
I'm having problems parsing your opinion, because you are mixing things. It is my feeling that you're trying to justify the usage of Node.js, coming up with reasons other than the language itself, especially since Node.js is quite immature in many regards.

Which is why I gave you a reply in the first place - you're making general statements because of very specific needs. I know it is fashionable to build a Facebook or Foursquare clone, however the UI is really not your biggest problem. There are other problems that are more important for applications like this, upon which you should pass judgment on choosing Node.js or Rails or something Java (IMHO, for applications like this I'm more inclined to use Java, as it has no technical limitations).

    what percentage uses the low-fi version of the site?
Progressive enhancements are much more useful than catering to users that haven't upgraded their browsers. It also helps with crawlers for instance, because the truth is only Google can crawl your website if it is JS-enabled and even they are having screwups. And maybe you think that Google should be the only game in town, however such a decision would be like optimizing your website for IExplorer only back in the day.

And the way I see it - you can add progressive enhancements when you need them, not sooner. Starting with a dumb version of a site and enhancing it gradually also makes business sense.

    It is my feeling that you're trying to justify the 
    usage of Node.js
I said nothing about Node.js. I said I want a framework on the client-side for the same reasons I want one on the server-side. A framework. Like Rails. For the client-side. So I can have organized code that people other than me understand.

    wikipedia
Wikipedia is a content site. I'm not talking about content sites. I'm talking about web apps. There's a huge difference. When I need a blog or a CMS, I guarantee you I'm not reinventing that in Rails. I'm using one that is proven and already solves that problem. And that's a whole other area of discussion. There will always be static pages. Those are the majority. But nobody should be serving those directly from a database. Those should be coming from disk or a cache or something.

I'm talking about interactive user experiences. In web apps.

It's about time to keep up with Zed Shaw tradition: the prediction that Alpha nerds will leave what was hot a few years ago with a lot of crappy code for the next generation.

Here's a prediction: 6 years from now, there will be more crappy heavy JavaScript based web-application out there and the biggest money making is to maintain and fix these apps.

That's not far off. I've made good money fixing Rails apps that have no tests :)
> I've been saying for about two years now that the days of serving entire HTML pages from the serverside are numbered.

No, there are clear use cases either way. On one hand you have documents, on the other you have multi-platform apps. For the former (which still vastly outnumbers the latter BTW), serving HTML from the server is the obvious choice, for the latter, a REST API is the obvious choice. There is a large gray area in between where you basically have documents with a relatively small amount of UI.

I agree that SOA based on REST service (particularly using JSON) are where the most interesting innovation is happening on the web today, but the venerable document model of the web will never go away because it actually fills a surprisingly large use case in a remarkably simple way (hence the success of the web in the first place).

Sorry, what I meant about serving HTML from the server was the construction of HTML documents using server-side code. There will always be static pages served with apache or whatnot :)
I think the whole point here is: build APIs first, wrap all the client code around them. If I have an API written in Ruby/PHP/node.js/Java/whatever, and a standard format (or protocol) to exchange data, I can then build the clients in Ruby/PHP/node.js/Java/whatever, clearly separating the backend and the frontend which can now be built in completely different ways using different technologies.

This is not new. There are lots of system out there built on top of private/public RESTful (XML/JSON/whatever)/SOAP APIs. There are both huge and small applications on top of distributed, stateless, components that clients can easily consume and that makes the whole architecture highly scalable (again: stateless). People can do this on HTTP, TCP, UDP or on TheirCoolProtocol.

great summary of architecture trends. i think there's a room out there for someone to build a framework with the server-side simpleness of Rails and the client-side elegance of Backbone/SproutCore
The author seems to consistently confuse architecture, languages and frameworks. None of his arguments have anything to do with Rails, Ruby, PHP or whatever else he mentions, except partly Javascript.

This seems to be a recurring pattern with developers who have "discovered" design and architecture through frameworks and can not seem to separate that from the tools used.

thought the same, like he says PHP was shit and still is (which is partly true) but then delivers CRUD Tasks, ORMs etc as the reason for Rails which also are very popular in all other frameworks for other languages nowadays.
"""but then delivers CRUD Tasks, ORMs etc as the reason for Rails which also are very popular in all other frameworks for other languages nowadays."""

The might be popular for "other languages nowadays", but he delivers those as a reason of Rails success BACK IN THE DAY.

And indeed it was. Not many PHP ORMS and scaffolding frameworks existed or where successful back then.

I think this is true but in my experience, they are what most people call "Application Developers".

Linus is still writing code in C even for a simple GUI app that wxPython can do for him quickly.

Josh Bloch is still writing code in Java since 97/98?.

Crockford/Resig will probably never write software in a language other than JavaScript.

Your Application Developer will quickly move to the latest trend spreading HackerNews.

So if you want to be famous writing frameworks or tools, make sure you hit frontpage of HN.

As an early Rails adopter who rarely gets to code directly on projects anymore (I'm a victim of my own success) I find it really curious when developers feel the need to post expository essays about framework switches. Things move fast and it would be bad for tech evolution to stop, so there's nothing to be loyal to unless you've placed awkward bets on the future of any given tool.

DHH said at the first RailsConf that he was tired of people asking if Rails would "hit critical mass" or become "ready for the enterprise" because Rails as a tool hit critical mass the moment it was useful to him and the core team that built Basecamp and Shopify. If anyone else found it useful then awesome, but everyone else can pretty much go fuck themselves.

Cocky? Sure. A lot of fun to be part of? Hell yeah.

I've never been on core but I can arrogantly speak for the early Rails community when I say that we excitedly encourage all Rails fans to try out Node, Django, SC and Backbone. Anything which captures your imagination and makes you see coding in a more whimsical, _why?-like way.

I recommend anyone that hasn't seen it check out Foy Savas' amazing talk from FutureRuby in 2009, Polyglots, Unite!

http://www.infoq.com/presentations/savas-polyglots

"I was coming from PHP. PHP was shit then and is still shit now."

I find it embarrassing that the community would vote up a story with comments like this. There is simply no need for it, and it shows nothing but a lack of articulation and outright immaturity.

If you don't like PHP, fine, but slamming it with one word insults does nothing but insult the tens of thousands of developers out there that use PHP to solve real world problems for a living.

The worst language I've ever written commercial web sites in is called OOiS-Script. You can't release memory, there is no such thing as an array, functions doesn't exist, there is no scope, when you handle XML you have to strip all namespaces because it uses ':' as the indicator for trasversal, there is no XPath so you have to loop through the levels and with a mere 3000 files processed one after another you can run out of memory on a machine with 4 gig of ram because the memory is not released until the request is done, etc.

I've done some really nice stuff with this language. But it's still utter shit in so many ways it's painful. PHP is in many ways a lot better, but has some pretty fundamental flaws that still marks it as really bad. He did however, not say one thing about the developers that use PHP, so why would you slam him for that?

"but has some pretty fundamental flaws that still marks it as really bad."

What flaws are these?

"He did however, not say one thing about the developers that use PHP, so why would you slam him for that?"

I've spent well over a decade of my life developing solutions for real world problems with this "shit" language. I founded a business on this "shit" language 4 years ago and we are going from strength to strength. So yeah, I think I have every right to slam him for insulting me.

Integers becoming 32-bit or 64-bit depending on CPU architecture, bad character-set support, comparison and identity is wacky. If anything of that has changed since last time I looked, all the better :).

He didn't insult you or slam you. He was talking about the language. You can make really neat things with a language that's really bad. Just don't take it personally.

>What flaws are these?

Have you ever seen this piece? http://tnx.nl/php.html

Some of the issues mentioned have been dealt with in PHP5 but a lot of the problems will probably be there permanently, such as inconsistent function names, arguments and return values mentioned at the top of the piece.

That isn't an insult to people using PHP. Much like I sometimes say that soda sucks without implying that soda drinkers suck, he's saying that PHP sucks without implying that PHP users suck.

When you insult something that is part of ones persona, you are insulting that person. Soda is an awful thing to compare to something that someone has spent a decade of their life expressing themselves with.
If all of what you've written is in earnest, then you've just insulted many soda lovers.

That said, the solution isn't to walk on eggshells around every topic that anyone could possibly have identified with. The solution is to be very, very cautious about making anything so much a part of one's persona that a stranger's critique of that thing feels personal.

In defence of PHP:

Firstly, every time I see it getting slammed its nearly ALWAYS PHP in comparison to a framework whether it's rails, django, web2py or whatever. As soon as I see this I can't help but feel the author is just jumping on the "PHP isn't cool bandwagon". PHP isn't a framework, so don't compare it to other frameworks.

Secondly, it is possible to write good code using PHP - and many people do. It powers some of the largest sites in the world and there are more PHP web devs out there than any other working on millions of PHP sites. There are also some excellent frameworks for PHP that are quick to learn, fast and powerful. Codegintier, Yii or Symphony(2) all spring to mind.

Finally, for most web developers who actually need to earn a living writing code to solve problems, PHP is still the most popular choice for good reason. It's easy to earn, easy to deploy, cheap to host and widely used. There are also more PHP jobs (especially in the U.K.) than any other and it isn't changing anytime soon. For the busy developer trying to make a living these type of posts aren't really helpful at best and at worst quite insulting.

I'm not sure you should put "write good code using PHP" in the same paragraph with "some of the largest site in the world". Because they're the exact opposite.

Facebook, Wikipedia, Wordpress, all of them don't have a good PHP codebase. In fact, people despise them.

PS: for the downvoters, why the hate? it's the fact though. I'm not saying you cannot write good code in PHP. What I'm trying to say is that "big sites out there" are not a good example of "writing good PHP code".

"""Facebook, Wikipedia, Wordpress, all of them don't have a good PHP codebase. In fact, people despise them."""

You've seen Facebook's codebase? I doubt it.

And when you show me a blogging platform more successful than Wordpress, then we will talk.

Who exactly despises FB, Wikipedia or Wordpress? Not the users.

And while I can't talk about Wikipedia and FB (haven't seen the source), neither do Wordpress developers (including the tens of thousands of plugin authors) despise Wordpress's codebase.

Also, it's not about how well you like it, it's about what you can do with it, and especially what you users can do with it.

Yeah, Wordpress could have been written in, say, elegant Haskell. And then it would have gotten nowhere, because very few people could have got it working on their webserver or on a shared server platform. And it would have lacked tons of extensions that PHP gives it, from Imagemagick to LDAP to DB2 client libraries --or it would have to use some less battle tested, less popular and less mature Haskell equivalents.

Facebook, Aditya Agarwal, presentation: http://www.infoq.com/presentations/Facebook-Software-Stack

Judge for yourself (you probably have to interpret what he said there since obviously he doesn't say up-front "it sucks" but the words he chose describe the situation).

Maybe despise is a strong word.

But what's your point? successful project so they must have good codebase or something?

My original post was that "those projects don't necessarily have a good code base" (thus you may want to choose other examples to show a better written PHP code base).

You're off by miles.

"""But what's your point? successful project so they must have good codebase or something?"""

I never implied that "because they are successful, they must have a good codebase". I actually made a different point, essentially asking in return:

What's a "good code base"?

Wordpress's, for example, is good at what it does, not in some idealistic theoretical way. Not only it resulted in a successful product (actually two: wordpress + wordpress.com), but it also has been proven stable (heard often of WP crashing mysteriously for any other reason that too much load and no caching which is totally reasonable?) and flexible to build upon (wordpress constantly adds features to its core and tons of developers add third-party add-ons).

I'd argue that "good" code base = flexible, extensible, successful, liked by IT'S developers. WP has had all of those. So, for THEIR PURPOSES and to THEIR DEVS, it is a good codebase.

On the other hand you implied that FB, WP, Wiki's code is bad. I tried to show that WP's at least is far from bad by MANY metrics. What are your metrics? Besides, say, proof by rigorous handwaving?

As for the FB presentation, he never says despise or sucks, as you mention. It's a classic presentation of some trade-offs. You'd have a selection of those even if you coded in Haskell or whatever.

A friend of mine recently left Yahoo in no small part because he hated working on their PHP codebase.

I don't know about the other sites you name, but if you had mentioned Yahoo you would definitely have had a point.

Also, "Bezos pulled a Hitler". I'm all for writing that, say, politicians who you don't happen to like are just like the Nazis, but this is taking trivializing of that regime just a bit too far.
This happens as time passes and events slip in societies memories. There are increasingly fewer and fewer people who were around to witness the atrocities of the Nazi rule, and even the people who knew of it second-hand are slowly disappearing. There's two groups of people who use the word Nazi and Hitler to insult someone; the first group is full of idiots who should know better and the second group is full of people who were completely unaffected by the history in any way, meaningful or not.

People compare societies to Rome all the time, saying America or the western world is akin to the downfall of Rome, seemingly oblivious to the atrocities committed by various tribes ransacking the Empire. Not that I agree with comparisons to Hitler or Nazis, I think they're arguments of a weak mind, but history was a long time ago.

I stopped reading at:

> PHP was shit then and is still shit now.

Way to go shitting all over so many peoples work.

So what web framework are we supposed to use now?
"So what web framework are we supposed to use now?"

Flippant answer: Whatever works

Pointed answer: I am paid to write RoR apps. When I need to get stuff done at home I use Perl, if it's for the web I recommend Dancer[1], which was inspired by (i.e. nicked from[2]) Sinatra[3].

I've found MVC to be a little bit too much architecture and scaffolding for many tasks.

edit: Not to say I don't want an architecture, but the routes and templating of Dancer are the essentials. Occasionally I will find myself missing the bloody lovely validations in Rails' ActiveRecord, but I am usually grateful for the light weight of the finished product and the fact that the entirety of it fits in my head when building with Dancer.

[1] http://perldancer.org/

[2] ;)

[3] http://www.sinatrarb.com/

"Think back to when Rails first came out. There was no iPhone. There was no Android. People still owned Nokias and actually bought stock in the damn company. Windows XP was still massively popular and we were fighting to get a decent version of IE (but that will never end). There was no such thing as a mobile web. No one was thinking about tablets. How old is the iPad? Not very old".

OK, no iPhone and the iPad is not very old. Wikipedia should change their contents, especially on the dates when the iPhone and iPad were launched.

tl;dr - web development is changing, the frontend side of things is gaining significance, while the backend is moving to, well, the background.

No reason to be surprised there, right?

It seems like the title is a bit poorly chosen.

The author talks about the importance of having a platform to cater to the multitude of devices and other apps out there, and that this means rails isn't the center of the universe anymore.

To me, this does not necessarily mean moving on from rails.

It does mean moving on from writing all code in rails.

There could be a fullfledged backbone.js app powering a responsive ui, and a distributed clojure jobqueue making sure messages are fanned out to their destined networks in the backend. However, there is still room in this picture for Rails as a router of sorts.

Rails still makes it easy to quickly build a solid REST api, and easy to delegate long-running jobs to a separate system, in this type of architecture, Rails would have roughly a third of the responsibility / code that it has in a Rails only architecture, but it's still a vital component.

"From my experience, generating a good UI (V) takes orders of magnitude more than implementing M and C."

yeah, because picking the right font has always been way more of a task than domain modeling.. (yes, i know that ui / ux isn't a breeze, but this depiction is just insane.)

TL;DR When web applications is written mainly in javascript and communicates with the server over json, what language is beeing used on the server becomes less important. As long as it's not php. ;-)
I did a single-page app before with GWT. I guess the GWT crowds beat y'all by miles since 2007.

The problem with this kind of web-app is that it's so much harder, so much more difficult, so much effort is required. And you need to be very very discipline and build automation testing from ground up (and I know many developers are just lazy to write automation testing, don't give me the start-up/iterate faster excuse, lazy is lazy).

At least with GWT, there are patterns and good practices to support unit-testing and modularizing your app properly.

In JavaScript? the fight just goes uphill straight away. In 2011, we still don't have automation test framework that is headless (console based) without requiring investment to infrastructure. And this is largely because the mentality of JS developers is to test in real-browser. Which is fine. Except the extra effort required to setup automation-test will cause a lot of people to find more excuse not to write automation test.

I get that developers are optimist people. But time through time, developers get burned so bad. Most people don't even know how to write JavaScript code properly but they're so ambitious. These people bite more than what they can chew.

So... good luck doing that while some of us will stick with Rails/Django/PHP/JEE6. Get ready, you're in for a lot of pain.