Python declarative

Frank Millman frank at chagford.com
Sun Jan 26 04:12:57 EST 2014


"Rustom Mody" <rustompmody at gmail.com> wrote in message 
news:3683cd10-592b-4a3d-ba77-b963a1aa2282 at googlegroups.com...
>
> Xml, originally a document format, is nowadays used as a data-format.
> This conduces to humongous messing, first for the xml-library writers, and
> thence to the users of those libraries because library messes inevitably
> leak past abstraction barriers to cause user-programmer headaches.
>
> tl;dr
> Frank's principle: "Express little as possible in <programming language>"
> is correct.
> "And therefore XML is the solution"
> is bad logic
> [Unless <programming language> == "java" !]

If that is the case, what is 'good logic'? JSON or YAML?

It does not make much difference which format I use. However, I will say 
that I found it a useful discipline to create an xml schema to describe my 
form definition, for two reasons.

Firstly, I was hand-crafting my form definitions initially, and as I added 
features it became unwieldy. Forcing myself to create the schema highlighted 
a lot of anomalies and I ended up with a much cleaner structure as a result.

Secondly, it has picked up a lot of errors in the resulting documents which 
would otherwise have generated hard-to-find runtime exceptions.

Frank






More information about the Python-list mailing list