Tim Bray is considering the technology choices to add a comment system to his blog;
I’d like to take this occasion to learn at least one new technology.
Now he mentions Rails but reading his thoughts on the design would have to agree with his conclusion that that’s overkill. For a start why inject a long list of dependencies and a steep learning curve for a relatively simple application (that applies to any framework BTW – not just Rails)? Also as he’s leaning towards files not DB so no need for ActiveRecord etc.
Anyway – strikes me the most sensible solution would be just a CGI script (probably Perl) – he plans static output – the comments are “compiled” on approval – doesn’t need to handle high load but (to reduce the pain of that admin interface) needs to be easy to hack the UI once he can see where the time goes.
But wandering back to this discussion…
I should really buckle down and try writing a PHP app
So taking a PHP tack – some random thoughts / discussion points;
- Do we recommend Tim use a forms library? E.g. QuickForm or Patforms (related point – where do we point him for help installing PEAR if needed)? Against this is I doubt the comment form really requires a full forms library – vanilla PHP?
- For comment markup, what to we want to point Tim at? As mentioned before, SafeHTML (packaged under PEAR as HTML_Safe) would allow posting raw HTML, perhaps with help from tidy to make sure it’s XHTML. There is PHP Markdown (don’t know much about this e.g. security record / UTF-8 handling) for a fairly standard markup. Alternatively Dokuwiki’s parser could be extracted (with a little hacking) – shouldn’t harm UTF-8 and shouldn’t result is broken XHTML. What else?
- For authentication OpenID seems to be on it’s way to becoming a serious contender – it seems like Wikipedia is planning to support it some time this summer (more on that later) – there’s libraries in pretty much any common language, although can’t say how rubust the PHP stuff is.
- A design somewhere in the realm of Rasmus’s no-MVC MVC, much as it’s controversial (see comments) design-wise, probably makes practical sense here.
- For the XML generation he mentions, DOM or SimpleXML (which implies PHP 5.x+)?
- What else to convince (or perhaps inadvertently discourage) Tim of PHP?