Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86473 > unrolled thread

Re: Python Worst Practices

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2015-02-25 21:52 -0700
Last post2015-02-26 10:09 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python Worst Practices Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-25 21:52 -0700
    Re: Python Worst Practices cl@isbd.net - 2015-02-26 10:09 +0000

#86473 — Re: Python Worst Practices

FromIan Kelly <ian.g.kelly@gmail.com>
Date2015-02-25 21:52 -0700
SubjectRe: Python Worst Practices
Message-ID<mailman.19241.1424926390.18130.python-list@python.org>
On Wed, Feb 25, 2015 at 1:45 PM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> http://www.slideshare.net/pydanny/python-worst-practices
>
> Any that should be added to this list?  Any that be removed as not that bad?

Using XML for configuration is a good example of a worst practice, but
using Python instead isn't best practice. There are good arguments
that a configuration language shouldn't be Turing-complete. See for
instance this blog post: http://taint.org/2011/02/18/001527a.html

The problem with XML is just that it's not very human-readable; it
doesn't need all the extra power of Python. This may be something
that's hard to appreciate until you've actually experienced an outage
because somebody checked in a configuration change that parsed and
passed tests but nonetheless was invalid due to configuration that
couldn't be evaluated until runtime. A better choice for configuration
would be something that is both easily readable and *simple* such as
JSON or YAML, or an appropriate DSL.

[toc] | [next] | [standalone]


#86490

Fromcl@isbd.net
Date2015-02-26 10:09 +0000
Message-ID<nv73sb-j98.ln1@esprimo.zbmc.eu>
In reply to#86473
Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Wed, Feb 25, 2015 at 1:45 PM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> > http://www.slideshare.net/pydanny/python-worst-practices
> >
> > Any that should be added to this list?  Any that be removed as not that bad?
> 
> Using XML for configuration is a good example of a worst practice, but
> using Python instead isn't best practice. There are good arguments
> that a configuration language shouldn't be Turing-complete. See for
> instance this blog post: http://taint.org/2011/02/18/001527a.html
> 
I agree wholeheartedly about XML, it's just not designed for what half
the world seems to be using it for.  Rather like HTML in a way, that
should have been a proper mark-up language.

-- 
Chris Green
ยท

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web