Meet Grok, the successor of through-the-web development ======================================================= For the most part I think that through-the-web (TTW) development as we know it from Zope 2 is a failed approach. I understand that some people see a lot of advantages in it, such as * non-developers apparently being very productive without having to learn how to "program," * the ability to develop collaboratively on one Zope instance, * restarts not being necessary, * the ability to fix bugs easily in the production system without needing shell access. I see most of those points as *dis*\ advantages (except for the reload thing, as that clearly helps with agility). TTW development misleads Zope beginners and tricks them into going down a very steep path that's hard to go back. TTW development vs. standard Python development ----------------------------------------------- In order to write a TTW application, you'll end up having to learn Python, even if you're not a developer per se. The problem is that you don't actually use Python like it's taught in the books. Instead of writing functions, classes or methods in modules, you write *Python Scripts*, which looks like a function/method without a ``def`` statement, are compiled using a special compiler that adds lots of security checks, and have some pre-defined top-level variables. To add obstacles to the weirdness, it's not possible to access standard Python functionality like opening files on the filesystem or importing a module from the standard library in TTW code, due to security concerns. The Z-shaped learning curve --------------------------- What happens if you hit said limitations of TTW development? You need to convert all that code in Python Scripts to actual functions, classes and methods on the filesystem. This is not a trivial task, filesystem-based code typically looks a lot different than TTW code. People have to basically *unlearn* what they've learned about Zope development so far and learn this whole other way of writing so-called "Products". This is why people jokingly referred to the "Z-shaped learning curve" when it comes to learning Zope: it's not a gradual process. Lastly, there's no automation for such a conversion, at least not for the whole process. There is FSDump_ which gets you half way, and there's Frostbite_ which gets you there but produces incomprehensible code that's not really meant to be edited further. Also both only work with the CMF. .. _FSDump: http://plone.org/products/fsdump .. _Frostbite: http://palladion.com/home/tseaver/software/Frostbite TTW development vs. established tools ------------------------------------- TTW development encourages working on *one* development system, even if you're multiple developers. One developer can easily break the whole application for the others and make a whole team unproductive until the problem is fixed. I've been there, it sucks. TTW development also makes it hard to impossible to use standard development tools such as an IDE, source control system and even a dead-simple thing like ``grep``. Non-developers don't care about this, you might say. That makes it even worse. TTW development discourages using standard practices and tools such as version control. I've consulted on Zope projects that where 100% TTW and had no source control. It made me uneasy. I wouldn't accept client projects like that anymore. Grok to the rescue! ------------------- Zope 3 gets many things right in this respect. It has pretty much done away with TTW development which means we don't have a Z-shaped learning curve anymore. That's good. The problem is that Zope 3 is lacking the equivalent of TTW development as a way to ease people into the platform. Right now you have to drink the kool-aid in one big gulp: Component Architecture, interfaces, security, ZCML and much more. The `Grok project`_ addresses that problem: it lets you get started with a Zope 3-style web application without having to learn about interfaces, components, or any of that stuff first. Its goal is to bring agility back into Zope and to flatten the learning curve for newbies. The good thing about Grok is that it doesn't make you unlearn things (unlike TTW development). You can gradually improve your Grok application and make use of interfaces, security, etc. once you learn about them. You don't have to throw away your old code. .. _Grok project: http://grok.zope.org Furthermore, Grok code is regular filesystem-based Python code. There's nothing funny about it. You write functions, classes and methods, just like that Python book taught you. You can use your favourite text editor. You can check your stuff into a source control system. Is Grok really as easy as TTW development? I believe so. `Kevin Teague`_ recently `shared his experience with Grok`_ on the mailinglist after writing a pastebin-like application: Consider the plain-text Paste view:: class PastePlainView(grok.View): "Plain-text view of a single Paste" grok.context(Paste) grok.name('plain') def render(self): return self.context.body Where in Zope 2 I might write:: ## Script (Python) "pastePlainText" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title=Plain-text view of a single Paste return context.body The Grok version doesn't seem to be harder to write as the TTW version from Zope 2. Au contraire, the Grok version is something that somebody familiar with Python will immediately understand. **Meet Grok, the successor of TTW development.** .. _Kevin Teague: http://bud.ca .. _shared his experience with Grok: http://mail.zope.org/pipermail/grok-dev/2007-March/000514.html