Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I haven't had the "pleasure" of working with web2py, and I'm not knocking the effort which Massimo puts into it, but the choices made there often elicit a raised eyebrow. Ignoring my opinion for a moment, the smartest web hackers I know universally regard web2py as a fundamentally incorrect way to approach web development—but usually say so in far more colorful terms.

I've just gone over the public discussions. They could basically be summarized in two points:

jacobian&ronacher dislike web2py's inclusion of a few new "builtins" (that is, they are builtins for a web2py applications). They used extremely colorful terms ("divisive! harmful!"), but that's essentially what it boils down to: It's fine that "len", "dict", and "list" are builtins, but it's horrible that web2py introduces a few more for web2py apps ("request", "response", "session", and a few others). Well, that's not much more than a difference of opinion. They feel very strongly about it, for some reason.

ronacher also dislikes web2py's use of "exec" for some reason. Almost all of his criticism is meritless (web2py precompiles for production, and the namespaces are used as he thinks they should be). The part that isn't, about classes with destructors leaking is valid, but it's a general Python "bug" that web2py potentially amplifies if you use it -- but it is not idiomatic in either Python or Web2py.

It's rather telling that every single strong criticism of web2py you can find on the web comes from someone who has never used it, and more often than not has some vested interest in a competing framework.

Web2py is not perfect, far from it -- but it is extremely well built, very robust, has a lively and helpful community, and gets things done quickly and well. Give it a try when you have the time and feeling curious.



So web2py introduces new members to __builtins__? Coming from a general Python programmer with no "vested interest" I have to say that isn't the best of ideas. len/dict/list are builtins because they are part of the language. They can be assumed to be present in any Python program. Teaching people that these web2py objects are available globally w/o importing them is setting a false expectation. This is pretty much monkey patching even if you aren't overriding stuff. Generally a no-no in the Python community.

With great power comes great responsibility.


No, notice that "builtins" was in quotes. web2py does not actually add new members to __builtins__. Rather, web2py executes model files, controllers, and views in a pre-defined environment that includes a number of web2py API objects (though not the entire API). This includes about a dozen core objects, such as request, response, session, and cache, plus a set of HTML helpers (all derived from the same class and named after their HTML counterparts) and a set of form validators (all derived from the same class). This is all very well documented.

People like you who have never actually used web2py routinely express concern that this will somehow set up false expectations and confuse people about how Python modules and imports work, but in practice this is simply not the case. Note, web2py also includes a number of modules that require explicit importing, and applications can include their own modules as well as import standard library and third-party modules. As a result, web2py developers are perfectly comfortable with normal Python imports and do not have any false expectations.

Web2py is indeed using its "great power" responsibly.


Your reaction is very similar to the reaction people who have never used Python have when they discover Python has significant whitespace (with no vested interest against Python): "That's a horrible idea! It failed miserably for Fortran 40 years ago! That goes against everything I was taught!". Yes, it does not fit exactly with some mental model you already have. But no, it does not set up false expectations, much like Python does not set up false expectations of whitespace significance for C programmers who wrote a couple of Python programs.

Anthony already addressed the details in his reply below, but let me just add: IPython and sage essentially redo the python command line, and get nothing but praise. web2py, in some limited contexts (models and controllers) introduces a few useful names into the global namespace, and gets a ton of criticism.

Django (and just about every other framework) introduces a whole new language for templates, and no one squeaks, wheresa web2py uses plain Python as its template language with the smallest modification possible to provide that (you need to add "pass" at the end of a block, because you don't have indentation to guide you properly inside an html template; other template languages add an "endif" one way or another), and no one cares.

It is telling that all this criticism is coming from people who never use web2py, much like criticism of significant whitespace comes from people who do not use Python.

It is bigotry, disguised as a technical argument. In both cases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: