[Python-ideas] Statements vs Expressions... why?
Adam Olsen
rhamph at gmail.com
Fri Sep 12 05:34:33 CEST 2008
On Thu, Sep 11, 2008 at 7:16 PM, Cliff Wells <cliff at develix.com> wrote:
> On Thu, 2008-09-11 at 15:53 -0600, Adam Olsen wrote:
>> On Thu, Sep 11, 2008 at 3:06 PM, Cliff Wells <cliff at develix.com> wrote:
>> > Also,
>> > go_make_some_side_effects() is probably ill-advised, and not something
>> > usually done in an FP style which you claim to be familiar with.
>> > Imperative programming is all about side-effects whereas functional
>> > programming is all about avoiding them.
>>
>> This isn't true when applied to python. We're about halfway in
>> between, regularly avoiding side effects (immutable int/str, sorted(),
>> iteration is generic and only covers reading), while happily doing
>> side-effects when appropriate.
>
> Well, I'd argue that *any* statement is causing a side-effect as it
> affects the flow of control or values of objects outside its own scope.
In a strict technical sense, sure. Perhaps it's better to say that
python encourages *containing* side-effects.
--
Adam Olsen, aka Rhamphoryncus
More information about the Python-ideas
mailing list