Hacker News new | ask | show | jobs
by dmragone 4880 days ago
Recently I discussed with colleagues why Ruby on Rails succeeded where no Python framework did. One hypothesis put forward was that there was 1 popular Ruby framework (Rails), but many popular Python frameworks.

I wonder if it will be the same for JavaScript front-end frameworks, with no one gaining the greatest mindshare.

Not necessarily make any claims about what's preferable (one framework to rule them all vs many competing options) - though I'm certainly curious about that as well for the front-end frameworks.

8 comments

I will give you my 2 cents on this argument.

tl;dr - Python had no web frameworks built in or community favorite. Rails was a complete re-think of how to do web apps in the age of XML (acaffolding, convention over config, etc.) Every language since has now realized this and copied Rails. This is a good thing.

if you want a story while drinking coffee, read below...

I was a serious Python guy from 1996 til 2006. I still like and respect Python. Before Python, I was a wanna-be Smalltalk fan. (This is important towards the end)

Python always had a philosophy of 'batteries included'. This means that it will have libraries for just about everything you need as supported parts of the language. Contrast this with Perl where CPAN quality was very hit or miss. Then contrast this with Lua or Scheme. They had too many libraries and none were standard. Most of those were, again, not supported or not of production quality.

As a result of 'batteries included', Python was just a dream to work with. Everything was doable or easy and performant 'enough'. I could go on, but that still wouldn't do it justice. They had a great language design, great libraries, and portability. Python is still a great framework. They didn't have a good 'CPAN'. This was ok, since the built-ins were good. Outside of that, it was a bit of a mess.

However, over the years, it became obvious that Python had a huge flaw. They did not deal with HTTP or HTML well. People don't even talk about this anymore, but the promoted framework was 'Plone'. This framework was so complex and convoluted, that building a simple web app was just not possible. It is not spoken about anymore. New frameworks popped up as a result, and very few of those were much good. This was a huge problem. Most people had to build their own production system. I had to switch languages for a job in 2002, and I didn't deeply follow the web framework discussion in Python for quite some time. I can tell you this, though. There wasn't a single framework that popped up as the winner or as exciting.

I'm typically a conservative. When I see a new thing, my typical take away is "this has been done before, what did they not learn from prior art". For example, lets say someone creates a new OS. If they don't really understand Unix, they will get it wrong.

When the first Rails screen-cast came out, I took a look. There was a lot of buzz that was increasing. I go, 'what the heck, it is only 5 minutes and it is a video.'

What I saw was an excellent architecture for building web apps. This architecture was better than anything else out there by quite a wide margin. They supported modern HTML. Convention over configuration. ActiveRecord was truly a treasure. The default site actually looked relatively decent (vs. the typical programmer, zero whitespace, huge serif, Netscape circa 1998 site). They URL conventions looked good. This architecture was human friendly. These people understood what a modern app should look like.

I was sold. Just from that screencast.

I believe in using whatever language is needed, if the framework is excellent. I wanted to build excellent web apps, so I learned Ruby. Ruby was easy to learn, and it is as good as Python. Much to my surprise it was the first language to pull off having Smalltalk blocks! People didn't even notice this and now they really like it. Everytime I showed this to coworkers, they would go 'what is that? I don't understand'. When people eventually learn Rails, they would go.. "check out these block things. They

So, in summary, Python didn't have a web framework. Rails was an excellent design, compared to any languages framework. Rails is pretty much going to be here for quite some time.

BTW, at this point. Rails is not my first choice. I think it is too heavy and web architecture has shifted a lot. Still, it would be in my top 3 choices.

Great summary and a joy to read. Having moved from Django to Rails not so long ago, I do enjoy some things in Rails, but feel the heavy-weight aspects you touched on.

Dealing with some of the deployment and infrastructure aspects of our rails app, I also see how much more memory and resources are consumed. Anything from Unicorn processes through rake tasks, to the time it takes to launch the console or run tests seem an order of magnitude longer. It's like steering a 747 or a cruise-ship. Once it's running it's fast and quite stable, with nice and comfortable features and lots of elegance. But it doesn't feel anywhere near as nimble and responsive as python/django (and django is by no means a small framework).

I'm wondering what's your top 3 choices today.

actually just re-read my post. it makes me cringe a little. I was in a hurry and hit send a bit too fast.

The other choices:

I like node.

I've always liked the async/model on unix. Their community is healthy and a lot of the open source is clean. The npm system is a good system. Even if you aren't running node, people are using node as their toolchain for pure front end development (css transform,asset pipeline). If you are doing anything real-time with a browser, it is my first choice. (Erlang used to be my choice there)

Also, yes Javascript has its pros and cons, but at this point everyone must know it.

As another choice, I still like sinatra with rack middleware. Very light and it works well.

Beyond that, it depends on the application. I might use C,Scala,PHP or ?? who knows what.

I went the other way, started using ruby and then switched to python because of the machine learning libraries and async frameworks. I found rails too bloated and too much magic and fell in love with minimal frameworks like tornado that i have a lot more control over. My productivity increased dramatically using tornado and flask. It seems like each of these languages have their phases to be on top, right now i am using nodejs and twitter storm for a project and i am finding it quicker to build async web services and the amount of async libraries is really helpful.

Scala is allowing access to some good java machine learning libraries and tools such as mahout, scalding, storm, akka, finagle, therefore i believe as a developer we should not define ourselves to a platform or language but we should always be curious and use the best tool for the job. I am not using tornado for my current project because nodejs had the async libraries i needed, that simple.

As business opportunities are arsing around big data, sensors and the internet of things our favourite platforms and languages are going to evolve as well.

Hi, good perspective. I've used Scala as well. Twitter held a meetup with Martin O back in 2007. At the time we started using it, the actor code was not ready for production. I think there is a lot of great activity in that space. I'm sure most of these have been addressed.

I also agree with your last statement. This is not the end of the road.

> I had to switch languages for a job in 2002, and I didn't deeply follow the web framework discussion in Python for quite some time

Good Lord. This is like 11 years ago?

heh - I didn't think about that til you mentioned it. Yes, but during the 2002-2007 time frame, I was aware of what was at the "front of the parade" for python. Nothing really stood out til Rails. If I knew Aaron Swartz, things might have been different.

Oh yeah, this reminded me of another painful thing back then. It was so difficult to find documented, clean MySQL bindings for python. Every experience there was terrible.

Learning Plone was a requirement for an internship I was considering in 2006, fwiw.
You have my sympathies.
Out of curiosity, what's your first and second choice?
Great writeup.

What would be your #1 and #2 choice?

see my reply above
It was my understanding that Django basically dominated the Python web framework field and is the Python equivalent of Rails. Is that not the case?
Django does dominate the Python web framework world. Flask does pretty well as a microframework runner up.

Methinks someone who left Python in 2002 is out of touch. ;-)

I would say Django (framework) and Flask (microframework) are the biggest. But lots of people build many mainly due to the WSGI support that makes it easy.

At first, I actually thought this post was about a PHP microframework called Flight: https://github.com/mikecao/flight

For JavaScript, it doesn't matter. It is privileged by being the only thing that runs in browsers.
There are a alternatives:

https://github.com/jashkenas/coffee-script/wiki/List-of-lang...

I, for one, really like Dart. It's very nice to use.

I, like most, hadn't even heard of Ruby before Rails. The two were synonymous - I remember having to explain to a number of people that should have know better that Ruby was a language and Rails was a framework.

I don't really know the history of Django but I'd wager it took a lot of inspiration from Rails.

Rails had that year's head-start on Django. By the time Django came along everyone was pretty deep into the development of Rails. I think it's mostly down to first mover advantage (it really did revolutionise web development).

In terms of frontend frameworks I have no idea what's going to happen.

Backbone definitely had the initial traction and it's nice and clean, but damn AngularJS makes development quick and easy. I've implemented things in the last couple of days in Angular that would have taken a week or more previously.

The Angular approach is unorthodox and seemingly inefficient but serves the developer well at the cost of CPU cycles.

Then again, I backed Prototype during the initial js lib battles and we know how that worked out.

> I don't really know the history of Django but I'd wager it took a lot of inspiration from Rails.

Not exactly. Django mainly came into existence as a formalization of a lot of helper functions that The Lawrence Journal-World newspaper found themselves building over and over again when they built web apps. Adrian Holovaty, Jacob Kaplan-Moss, and Simon Willison created Django separately from Rails, even if it wasn't released publicly for a while (and then got kinda stuck at 0.96 for a while after that).

It's like Newton and Leibniz with calculus or Darwin and Alfred Russel Wallace with natural selection; there were a lot of similar problems to be solved in the web dev space in the early '00's, particularly around accessing databases, structuring URLs, and handling authentication, it makes sense that a few similar approaches would show up around the same time.

If you're really interested in the history, this "Snakes and Rubies" video is worth watching: http://www.youtube.com/watch?v=cb9KDt9aXc8

(I should mention that I tend to personally prefer Python to Ruby, very much like Django, consider Adrian Holovaty a friend and we both once worked at msnbc.com at the same time.)

Ah, thanks for the info - need to learn my history a bit better.

My point still stands, I think that by the time Django made it out into the world Rails was already established as the dominant framework. Django 0.96 hadn't been as thoroughly thrashed as Rails and definitely had the warts to prove it.

Django is a much more mature beast these days, though I still lean more towards Flask if there's a choice to be made.

That's a good summary. I answered a question on Quora about this which goes in to a bit more detail: http://www.quora.com/What-is-the-history-of-the-Django-web-f...
> It's like Newton and Leibniz with calculus or Darwin and Alfred Russel Wallace with natural selection; there were a lot of similar problems to be solved in the web dev space in the early '00's, particularly around accessing databases, structuring URLs, and handling authentication, it makes sense that a few similar approaches would show up around the same time.

And can you imagine, they could have patented each and every one of those solutions, and spurred their competitors to greater innovation! What a surprise that they didn't - how silly of them. /s

First Django succeeded. i.e. Instagram and Pinterest. Second you guys have Sinatra. Quite often when I inspect a webpage of a notable site, I find Backbone in the mix. Agree or Disagree?
Or, Rails was well-marketed, had lots of 3rd party plugin components, and actually had database migrations (oh the pain of databases and models in early Django)
Javascript front-end framework are really new (3 years old) compare to web frameworks. The need is also quite different. There was a need for a Javascript framework and we can say that jQuery won the battle. We will have to wait few more years to see most of the web app running with a Javascript front-end framework, then you will maybe have a winner!
If Django isn't a shining example of a Python web framework succeeding then I don't know what is.