4 ms·
Except that that's not just a "Hello Word" page. That's routing to the right page, transaction and session control, storing the text of the message in a separa
by AndrewDucker 12y ago
Except that that's not just a "Hello Word" page.
That's routing to the right page, transaction and session control, storing the text of the message in a separate class than the one that returns the response, and using a template to return the resulting HTML.
Looking at the section with the actual example code in it, you could do it in about half that, if you wanted a simple version that just returned "Hello World".
If you don't want routing, templating, separation of concerns, etc. then you wouldn't be using a framework like that, of course.
- yazaddaruvala 12y agoI think its satirical. We all know Java's Hello World is ~10 lines long. I think the point/joke is that Java EE devs don't keep things simple. Or rather, better put, Java EE devs always want "routing, templating, separation of concerns", because they consider it better, no matter the current problem at hand.
- raverbashing 12y agoThis does almost everything (and sending it to another class is pretty trivial): http://flask.pocoo.org/docs/0.10/quickstart/ http://flask.pocoo.org/docs/0.10/quickstart/
- AndrewDucker 12y agoYup. And by the time you've done all of that, it's not vastly smaller than the code in the original example. (Also, your setup is spread across every class registering itself, rather than in one central XML file that tells you all of your routing.)
- raverbashing 12y agoNo, it's usually done in a separate file containing all the routing (in most Python frameworks) And no unreadable and overcomplicated XML for configuration, thank you very much