[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BRL (was Re: XML as a transition to s-expr)



I'm going to play Devil's Advocate here for a second, despite being
somewhat impressed by BRL.

Bruce Lewis writes:
> BRL is substantially more newbie-friendly in the areas PHP is reputed to
> be friendly in: database integration, e-mail.
> ...
> [
>  (mail (list "nobody@example.com")
> ]To: nobody@example.com
> Subject: [name] is [age]
> 
> You just got a form filled in by somebody
> claiming to be [name] (age [age]).
> [)]

That's not too bad.  It'd probably be more readable if it were written
like this, though:

[(mail (list "nobody@example.com")]
To: nobody@example.com
Subject: [name] is [age]

You just got a form filled in by somebody
claiming to be [name] (age [age]).
[)]

Or possibly with the whole thing indented to match surrounding code:
    [(mail (list "nobody@example.com")]
    To: nobody@example.com
    Subject: [name] is [age]

    You just got a form filled in by somebody
    claiming to be [name] (age [age]).
    [)]

Do you think this kind of tidying is something that would occur to a
newbie?  If you run my tidied versions, do they work?  (Having written
a few RFC-822 messages and message parsers, I suspect not.) If not,
what kind of diagnostics does it give you?

> What if they want a literal double quote in the body of the e-mail?
> PHP requires backslashing.  BRL does not.  Typical alt.php question.

What if they want a literal left square bracket [ in the body of the
e-mail?  How do you accommodate that without some variant of
backslashing?  (I understand that square brackets are less common in
HTML than double quotes!)

> Do the dollar signs, backslashes, commas and semicolons in PHP
> really help make things more readable?

I'm not going to claim that PHP is readable.  Nosirree.  But the
difference between commas and semicolons often makes programs in
general more readable, because your eye can locally distinguish
creating a list of values with commas from running a sequence of
statements with semicolons.