[Chicago] Factoring fun with functions in Python

Martin Maney maney at two14.net
Fri Nov 16 04:00:46 CET 2012

On Thu, Nov 15, 2012 at 07:41:57AM -0800, Dan Krol wrote:
> Sure, I'm not against writing one or two line functions or one or two
> function modules when it represents appropriate coupling. I was just
> focusing on the fact that *every* function in the example was like
> this, and perhaps I took that aspect of the example to be a key point
> when I shouldn't have.

Yeah, sorry, it was early and I was short on time before I had to get
going.  I was really more agreeing with your remarks, but replying to a
bunch of other replies that, if I understood them, seemed to be
unreservedly approving of this IMO poor example of program refinement. 

I too have had a very hard time seeing it as anything more than
pointless text shuffling.  Replace db.cursor() by get_cursor(db)? 
That's just playing with the text; perhaps it was a mistake to give up
punch cards after all. :-/  If the former is so obviously correct when
it's inside the latter, what makes it less obvious inlined, without the
cargo-cult trappings?

If the best we can do is make technology as dangerous, non-robust,
capricious, arcane, alienating, marginal, and costly as "magic",
then we have really crappy technology.  -- goliard

More information about the Chicago mailing list