Skip to content.

plope

Personal tools
You are here: Home » Members » chrism's Home » TTB Programming
 
 

TTB Programming

Instead of TTW programming, why not TTB programming?

This continues the "agile content development" thread that has been mentioned here and elsewhere. In the vein of that thread, I'd like to suggest a replacement for "through the web" (TTW) programming. I'm going to call it "through the book" (TTB) programming.

Through the book programming is almost too simple to describe. Instead of creating an alternate programming environment for people with less experience ("scripters", "site developers", "content developers"), I suggest they use the same environment that the people with more experience have and we make that environment more self-consistent via documentation, repeated patterns, and code generation.

Documentation: for Zope 3, this is Jim's tutorial, Phil's book and others of the ilk. Zope 2 is a bit of a lost cause in this respect; because it's not self-consistent, documenting Zope 2 is a process of documenting a litany of exceptions, which is impossible, because new ones are continually found at a blistering pace.

Repeated patterns: Python is the poster child for repeated patterns; this is why it's often referred to as "runnable pseudocode". For Zope 3, interfaces and adaptation are self-consistent patterns that extend Python in simple but important ways. Zope 2 is also a lost cause here also due to its organic growth process and inability to figure out what it wanted to be.

Code generation: often just starting a project is the very hardest thing to do. Projects like Ben Saller's "Skeletor" aim to make this easier by generating template projects for various tasks. This could work for both Zope 2 and Zope 3.

The benefits of this pattern are these:

  • We don't need to create and maintain as much software (just the skeleton generators) as we would if we created a framework solely for "scripters".
  • Solutions created by a "scripter" would not need to be scrapped and started over once the scripter "becomes a developer" (which is just the natural order of things even if you believe there is a difference in the first place).
  • We follow the lead of Python, which is an environment which "scales" from simple procedural programming to behemoth object models without requiring a developer learn all of its concepts at once.

Problems:

  • There is a temptation to prematurely generalize a problem and solve it in a core framework, making its solution difficult for new users to understand because it's by nature quite fuzzy. I'd point at the variety of tasks performed in the ZMI in Zope 2 as an example as well as maybe even things like the addform/editform configuration in Zope 3. The solution? It's good to have these kinds of things live outside the core framework entirely; once they've been beaten on for a reasonable amount of time (this could be years) and have proved useful and self-consistent, integrate them. This is really just a matter of being discerning.
  • TIMTOWTDI... ex: do I put this logic in TAL+TALES expressions or in a view class? One solution is to choose technologies that make these distinctions clearer (maybe don't use TAL). The other is to clearly document best practices. The former is easier.
  • New users won't use it because it doesn't have a GUI. No way to solve this one without writing a set of GUI tools, but another option is to just say "oh well" and move on with life.
Created by chrism
Last modified 2005-12-20 03:13 PM

Code Generation vs. GUI?

<blockquote>"New users won't use it because it doesn't have a GUI. No way to solve this one without writing a set of GUI tools, but another option is to just say "oh well" and move on with life."</blockquote>

If you create a code generation tool that is reasonably capable, wrapping it with a GUI should be pretty simple. This isn't the same as having a GUI *editing* environment for your generated code, but it's a pretty good first step to getting a new user comfortable.

For example, I noticed that the Zope3-sandbox package I recently installed on Ubuntu popped up a GUI wizard to walk me through setting up the sandbox instance. Pleasantly surprising.

how to help designers/tweakers?

I think your suggestions solve the problems of customizers somewhat, but may not be enough. Let me reiterate the case again.

One class of user that I need to serve is someone who likes to tweak site design. This is mostly HTML tweaking, but does involve some TAL and simple Python expressions, pulling information out from an underlying application. It's a limited experience that you could consider to fit your "by the book" approach, but they do seem to need certain things that Zope 3 currently doesn't offer them.

Such people want a fast turn-around, and want a low dependency on tools (such as version control systems and editors). These people are not programmers and won't be learning how to check stuff into SVN any time soon. They *do* want the ability to tweak a bit in a site's design, or an app's UI, through a TTW environment. They currently get this with Zope 2, and they don't get it with Zope 3 or Five.

And then, what *I* want is a way to take some of what they've done under version control, under maintenance, clean it up, develop it further, without too much hassle.

Perhaps this class of users is so small they're considered unimportant, or perhaps they're not engaged in this discussion because we're programmers talking amongst ourselves. I think I heard from some of them at the last Plone conference, where I heard the question "well, but can you work with this through the web, without restarts?" a few times, in the context of Five. When they heard "No", they weren't exactly happy and said it was important for their way of working. It's not my way of working, but their way works well enough for them, so they obviously don't like hearing "change your way of working" for an answer.

TTW is a GUI

Maintaining a traditional GUI is a bad idea IMO. It's too much work and too hard to maintain in such a fluid environment. Seems like most of these types of efforts turn into vaporware.

TTW is already a GUI. For some things TTW just works, since we're really just talking about some html forms, it really should be easy to create and easy to use. I work with a diverse user base ranging from interns and designers to sales reps and editors. For entering data it works great. I use two different bastardized versions of Plone for two different newspapers and they report that content entry is easy to train and maintain.

Skinning the site is more of challenge. There is no way I'm training designers the complexities of a Zope Page Template much less the complexity of a Plone template. For both sites I use Cheetah instead of ZPT and use a TTP (through the plone) skinning system. Not everyone knows how to svn, but everyone knows how to undo. This works okay. It obviously has all the problems mentioned with TTW development and is a mess to look at, but it's not as hard to understand as ZPT or as hard to follow as PHP.

IMO site maintainers need

* TTW skinning with unlimited undo and access via webdav
* Simple templating - sorry, pymeld is nice but can't be used without a programmer, I like django templates but use <!-- for loops and conditionals
* TTW installable products (like a combination QuickInstaller/egg downloader)
* TTW configuration (exportable via webdav) - shouldn't need to dive into file system to change the date format
* Seperate admin, public and preview skins - not one template fits all like Plone
* User, group and role administration




Grok is the TTB for newbies

I agree with you, Chris, though something that's as easy to get started with as TTW development is needed for all that Zope 3 stuff. That's what Grok (http://grok.zope.org) tries to be (see also http://www.z3lab.org/sections/blogs/philipp-weitershausen/2007_03_27_meet-grok-successor).