Flask and Javascript-centric front-ends
- From:
- Aaron Kavlie
- Date:
- 2011-01-31 @ 20:07
There's been a big move toward Javascript-heavy web apps in the last couple
of years, and new tools & frameworks are springing up to ease JS development
-- see Backbone.js, Knockout.js, etc.
The model here is typically to move almost the entire app to the front end.
After the initial page load, everything happens in a single page, with no
page refresh. A server-side backend is still (usually) a necessary
component, but it's reduced to a dumb pipe to shuttle data to/from the
database via JSON.
This approach makes it possible to create much richer apps with lower
latency, so it's a pretty clear win for user experience. I'm creating an app
right now (in Flask) that could benefit from such an approach.
The problem is that you have to write most of your app in JS to do so. It
also appears to increase the complexity of development quite a bit (beyond
just learning a new tool), and tools in this space are fairly new and
immature. But I think it's clear that this is where web development is
headed.
Most server-side frameworks are still firmly rooted in the old way of doing
things. It's *possible* to pair them with a JS-centric front end, sure, but
you give up most of their power by doing so. Do you see frameworks changing
in the next couple of years to accommodate this approach? Are there big
roadblocks to doing so?
Lift, for one, is a server-side framework (written in Scala) that
auto-generates a JS front-end - http://liftweb.net/
btw, for more on these concerns see these talks from DjangoCon:
"Django is obsolete (but so is everything else)" -
http://djangocon.blip.tv/file/3039582/
"Now What" - http://djangocon.blip.tv/file/3043324/