How much sanity checking is required for function inputs?

Michael Selik michael.selik at gmail.com
Fri Apr 22 16:40:45 EDT 2016


On Fri, Apr 22, 2016, 1:26 AM Stephen Hansen <me at ixokai.io> wrote:

> On Thu, Apr 21, 2016, at 08:33 PM, Christopher Reimer wrote:
> > On 4/21/2016 7:20 PM, Stephen Hansen wrote:
> > > I... that... what... I'd forget that link and pretend you never went
> > > there. Its not helpful.
> >
> > I found it on the Internet, so it must be true -- and Pythonic at that!
>
> My advice is to not look at that site further. I can't count the number
> of things that are just... not useful or helpful.
>
> Directly translating the Gang of Four Design Pattern book to Python
> doesn't generally result in useful ideas, except in certain abstractions
> like the visitor pattern when you're designing big systems.
>

Frankly, for someone coming from Java, the best advice is to not write any
classes until you must. Of course classes in Python are very useful. It's
just that your Java habits are unnecessary and often counter-productive.

Just make some globals and some functions. Heck, even write procedurally
for a while. Free yourself from the Kingdom of Nouns.
http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html

>



More information about the Python-list mailing list