General question about Python design goals
Wed Nov 30 07:45:56 CET 2005
Mike Meyer <mwm at mired.org> writes:
> > An awful lot of the time in this newsgroup, "practicality beats
> > purity" translates as "the programmer can just be a lazy slob".
> You post that as if it were a bad thing.
Yes. The idea of using a program that someone else wrote, is that
they do the work so I don't have to. If their doing less work means
that I have to do more, the program isn't as good as it might be.
A program like Python intended for wide distribution and use by large
numbers of people whose needs aren't known in advance, should do as
much to help its users as development resources allow.
Are you familiar with R. Gabriel's piece "Worse is better"? That's
not what I see "practicality beats purity" as being intended to mean.
> > If following POLA costs that much, at least in the kinds of examples
> > we talk about all the time here, something is probably wrong with the
> > implementation (or the design) to begin with.
> True, but not constructive. Knowing that something is wrong is
> easy. Diagnosing the problem is harder. Curing it is even harder.
Look at the list.count() example at the start of this thread.
Diagnosing it isn't hard. Curing it isn't hard. It doesn't bloat
Python by an order of magnitude. A suitably factored implementation
might handle lists and strings with the exact same code and not incur
any extra cost at all. That type of thing happens all the time here.
More information about the Python-list