[Chicago] Factoring fun with functions in Python

Dan Krol orblivion at gmail.com
Wed Nov 14 19:24:58 CET 2012

Thinking more, I realized that in Haskell, this one-or-two line
function thing is practically enforced in the language, with the
exception of do notation. You somehow I do. I do think the concern I
brought up does happen there though. Not having higher level grouping
makes everything completely flat. I mean, we split things into files
for readability. There must be something to be said for hierarchy.

Good point on the testing. Somebody mentioned namespacing. So
basically make a class, and make all these things class methods? That
would pretty much accomplish the same or better as far as visually
grouping similar concerns, while still allowing for testing. Perhaps
I'll try that going forward.

On Wed, Nov 14, 2012 at 9:36 AM, kirby urner <kirby.urner at gmail.com> wrote:
> On Wed, Nov 14, 2012 at 7:09 AM, Garrett Smith <g at rre.tt> wrote:
>> While it's hard to avoid side effects entirely (e.g. printing to
>> stdout is a side effect), we can certainly be aware of them and try to
>> make our functions side effect free as much as possible. If we're
>> purists, we can use a language like Haskell that handles this problem
>> explicitly [2].
> A blog post on functional languages vs. imperative (so-called):
> http://worldgame.blogspot.com/2012/10/functionalism-versus-objectivism-again.html
> I am using more Haskell myself in my curriculum writing (which writing I
> gave a presentation about at Portland User Group last night, one of
> two talks on teaching / learning Python).
> Kirby
> (in Portland, lurker on Chipy)
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago

More information about the Chicago mailing list