PEP #99484663

dave at pythonapocrypha.com dave at pythonapocrypha.com
Mon Nov 11 11:52:12 EST 2002


On 10 Nov 2002, Ian Bicking wrote:

> On Sun, 2002-11-10 at 21:48, Dave Brueck wrote:
> > You don't hear of long-time Python users complaining about the indentation
> > thing; 
> 
> As an exception, anyone who uses or implements Python-embedded-in-HTML
> style systems wants (and usually adds) an explicit block delimiter. 
> It's essential in that domain.

That's one way to look at it, sure, but I'd argue that either (1) Python
is the wrong tool in that circumstance or (2) it's an un-Pythonic approach
to solving that problem.

Setting aside the issue of whether or not it's a good idea to mix logic
and presentation that closely anyway, the fact that Python + HTML (with OR
without a delimiter) is so ugly should be a strong indication that there's
something wrong. ISTM that using a block delimiter is a band-aid fix to a
symptom where the real problem is that you're trying to do something in
Python a certain way because that's the way it's done in other languages,
rather than it being the best approach to the problem.

FWIW, I don't find the blocks-of-code-embedded-in-HTML to work that well 
in other languages, either. :) It has always felt like such a hack and the 
result is unreadable and thus tough to maintain.

-Dave





More information about the Python-list mailing list