begin quoting Andrew Lentvorski as of Sun, Feb 04, 2007 at 05:28:16PM -0800:
> Stewart Stremler wrote:
> >I recently ended up looking at XML that had a <section> tag, and
> ><section> tags could contain other sections. Trying to match up
> >the </section> with the appropriate opening-tag *sucked* -- same
> >problem as trying to match up braces, parents, or brackets, only
> >more difficult.
>
> Oh, dear God, no ...
>
> Talk about missing the whole point ... wow.
This is XML as I see it in practice, where managers say "Are we using XML?
No? Why not? It's a standard! Use it!" It one of the reasons I really
despise the idea of using XML for every little data file out there.
> >>So which is worse? Pythonic whitespace or XML unreadability?
> >
> >Pythonic whitespace.
>
> Sorry, I'm going to disagree on that one. Just about anything XML is
> worse than anything else non-XML. This, however, is due to the extreme
> suckiness of XML, not due to the goodness of what it is being compared
> against.
Heh. As bad as XML is, it /could/ be worse.
> The one gripe I do have about Python whitespace is that automated tools
> have no way of knowing when it ends. That causes me more than a little
> grief sometimes.
It causes me a lot of grief all the time. This XML file I was
discussing was "accidently" reformatted a few times. (All
non-significant whitespace removed once, all attributes for a
tag put on the same line as the opening tag, etc. -- Gotta love
it when developers commit files without *looking* at 'em.)
A friend of mine uses the whitesmiths style
keyword ( stuff )
{
code
}
...which drove me nuts, until I started adding end-comments:
keyword ( stuff )
{
code
}
//keyword
...and then I had FAR less of a problem reading his code.
I think that if Python had an ending-keyword, I'd've not acquired
such a violent allergy towards it.
Ah, well.
> Personally, though, I like the fact that the indentation style is
> specified. It means that every piece of code is indented exactly the
> same way. Given that code should be written for humans to read, that's
> a good thing.
And yet, I note that we're not trying to fully justify out prose
here (well, aside from my instinctive attempts at bricktext, but
those shouldn't count). I agree that code should be written for
humans to read, but that's a responsibility that is given to the
programmer, not the language.
The whitespace-indentation requirement is, to me, like imposing
a requirement on English writers to always write bricktext, and
still maintain a natural "flow" to their prose. Sure, it can be
done, but is it worth it?
> However, I'm sure that if you used braces and mandated indentation,
> people would gripe about that too. This is why we have multiple
> programming languages.
Yes.
Which is one of the reasons I really really really don't like the
one-language-to-rule-them-all philosophy that is sometimes espoused
by fans of one language or another.
--
Democracy: everyone making sure no-one else is allowed to be Emperor.
Stewart Stremler
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list