Python is going to be hard

Chris Angelico rosuav at gmail.com
Thu Sep 4 09:30:10 EDT 2014


On Thu, Sep 4, 2014 at 11:15 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> How do each of these apply when comparing
> a. A program that defaults to passing and returning data structures and
>    uses print in a very controlled way
>
> b. A program that randomly mixes call/return with input/print

Considering that I've never seen anything that *randomly* mixes them,
I can't really say. But you clearly don't dislike print nearly as much
as your earlier posts imply, because it can be used in a "controlled
way" as your potent comparison point. So how about you show me some
real example code, something real-world that you hate, and show me how
you'd rewrite it to not use print() calls "randomly mixed" with other
stuff, and then we can discuss. I think we'll find that our views
aren't as much different as it would seem; both of us believe in
separating guts from UI, both of us believe that side-effect-free
functions are easier to comprehend than those that unexpectedly change
state, and both of us want to make programs that can be read and
reasoned about. The only difference is that I see print as an
important tool as part of a balanced meal, and you see it as something
distasteful that you regrettably have to include. But we both use it.

ChrisA



More information about the Python-list mailing list