My tentative target audience is someone who knows Clojure well enough to have written some sort of substantial program, doesn't know Ring at all, doesn't know the Ring-equivalents in Ruby or Python, has written a webapp (even if only a trivial one before) but didn't necessarily do it in Java (so the only knowledge of servlets etc. I'll assume is the knowledge they exist).
Is that a good audience?
In keeping with the other books I've done for the Prags, it'll be pretty hands-on, with lots of "Try This Yourself" sections.
What topics would you like to see me cover?
-----
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Author of /Programming Cocoa with Ruby/
www.exampler.com, www.exampler.com/blog, www.twitter.com/marick
It seems likely that web programmers disappointed with mainstream
languages will drift to Clojure over time. They will probably want to
try writing a web app first, and getting started isn't that easy right
now (although the available tools are quite good, they require
understanding). It just seems to me that the number of Ruby+Python
programmers curious about Clojure exceeds the number of experienced
Clojure programmers who have a hard time with Ring and servlets.
> What topics would you like to see me cover?
1. Interactive development in the REPL is, in my opinion, an
absolutely essential topic. It might be asking too much for a short
book to cover all the interactive-capable environments, though.
2. Middleware is an obvious one. Can't live without it.
3. I'd like to see a discussion of the tradeoffs between Lisp-syntax
server-side templates, and limiting server interaction to REST-style
services. It seems to me that Clojure is pretty unique in being great
for both.
4. (Shameless plug:) You should, of course, talk about
appengine-magic, the easiest way to get a Ring webapp in production.
:)
On Wed, Dec 1, 2010 at 11:17 AM, Brian Marick <mar...@exampler.com> wrote:
2. Middleware is an obvious one. Can't live without it.
This is something I'll definitely look forward to! Documentation is
currently one of Ring's weak points.
> My tentative target audience is someone who knows Clojure well enough to have written some sort of substantial program, doesn't know Ring at all, doesn't know the Ring-equivalents in Ruby or Python, has written a webapp (even if only a trivial one before) but didn't necessarily do it in Java (so the only knowledge of servlets etc. I'll assume is the knowledge they exist).
>
> Is that a good audience?
That tends to be the audience I assume when I'm writing documentation.
Other books provide a good introduction to Clojure, and it's
reasonable to assume that most developers writing a web application in
Clojure will have had some past experience.
> What topics would you like to see me cover?
As other people have said, it might be a good idea to start with an
overview of how Ring is structured. An explanation of how handlers and
middleware work is probably a necessary foundation.
Coverage of the standard Ring middleware might also be useful. People
frequently ask questions about session handling on the Compojure and
Ring mailing lists. Perhaps some 3rd-party Ring libraries like sandbar
could also get a mention.
Testing Ring is something I've been thinking about a lot recently, so
perhaps a chapter on how to unit-test Ring handlers? (Shameless plug:
I'm currently writing ring-mock, a library for generating mock request
maps for tests).
It might also be worth showing people how they'd go about creating
their own middleware. For example, maybe some middleware to add a
standard template, or some middleware to translate response bodies to
JSON. Custom middleware tends to be used a lot more in Ring than in
Rack, I've found.
- James
> Testing Ring is something I've been thinking about a lot recently, so
> perhaps a chapter on how to unit-test Ring handlers? (Shameless plug:
> I'm currently writing ring-mock, a library for generating mock request
> maps for tests).
I'm thinking of documenting existing middleware with Midje "facts".
(Midje is test framework. https://github.com/marick/Midje/blob/master/README.md)
Your ring-mock would fit in nicely. I have it flagged to check out.
-----
Brian Marick, independent consultant
Mostly on agile methods with a testing slant
I'm inclined to agree. This book seems intended to be about Ring
specifically, rather than the more general topic of how to write
Clojure web applications.
- James