Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77527
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.015 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'value,': 0.04; 'that?': 0.05; 'subject:Python': 0.06; 'intermediate': 0.07; 'problem:': 0.07; 'variables': 0.07; 'meantime,': 0.09; 'statements': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'useful,': 0.14; 'changes': 0.15; 'effect.': 0.16; 'fine.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'immutable,': 0.16; 'pockets': 0.16; 'somewhere.': 0.16; 'unexpected': 0.16; 'utterly': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'programming': 0.22; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; "aren't": 0.24; 'copied': 0.24; 'instance,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'function': 0.29; 'possibility': 0.29; 'quickly': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'code': 0.31; 'purely': 0.31; 'question:': 0.31; 'sep': 0.31; 'weeks': 0.32; 'advice': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'building': 0.35; 'there': 0.35; 'introducing': 0.36; 'two': 0.37; 'system,': 0.38; 'saves': 0.38; 'pm,': 0.38; 'anything': 0.39; 'functional': 0.39; 'enough': 0.39; 'how': 0.40; 'completed': 0.61; 'entire': 0.61; 'matter': 0.61; "you'll": 0.62; 'information': 0.63; 'telling': 0.64; 'side': 0.67; 'lose': 0.68; 'results': 0.69; 'therefore': 0.72; 'computers': 0.72; 'animation,': 0.84; 'effects,': 0.84; 'facilitating': 0.84; 'guts': 0.84; 'partial': 0.84; 'presumably': 0.84; 'preventing': 0.84; 'single,': 0.84; 'upwards': 0.84; 'zen': 0.84; 'absolutely': 0.87; 'reasoning': 0.91; 'to:none': 0.92 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=oTeFUYeJ6RpOrePxg6H7YHJQp7GnjVbZpO1Euk1E+D4=; b=BQWIbq7duivMawUFEIKPaXAyNST3hLxM/MEwfFygncAX31nOt2Rcnrnpmn9TJ6B5kY Jase3fc5HEz2tM7aUs0Szy1js8OYiwTFThu/IkWY+oJddhAtfWiJSAMxwty74fTQB4PB uT27O0tmUxNd7AgmPwB6I3981Di2T8vj7sXRDOW0E7SSHY5CEbttdij6U8iDkm7IDACN gVlmkJJPhYPgfCkKbPzPq9EOL+YrFE9kaETcmntkhnuXsHM6YvrmxMtqJvyfaloZb5zN fknVrrR+l8uTXVpZe1chdvhAGQVyPTYQdUNTgMPXnLaiTPGMZ843LmOj+aR1ShUieQel ztsw== |
| MIME-Version | 1.0 |
| X-Received | by 10.43.136.134 with SMTP id ik6mr1896128icc.6.1409802573856; Wed, 03 Sep 2014 20:49:33 -0700 (PDT) |
| In-Reply-To | <d80e4c36-74e8-4850-8ad1-e357e895abcc@googlegroups.com> |
| References | <d9me0ap5s0s28qaeobbh6680gciel6c1og@4ax.com> <51acfec6-6b7b-4773-8d70-0360381bbed1@googlegroups.com> <mailman.13751.1409795794.18130.python-list@python.org> <d80e4c36-74e8-4850-8ad1-e357e895abcc@googlegroups.com> |
| Date | Thu, 4 Sep 2014 13:49:33 +1000 |
| Subject | Re: Python is going to be hard |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.13756.1409802577.18130.python-list@python.org> (permalink) |
| Lines | 36 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1409802577 news.xs4all.nl 2907 [2001:888:2000:d::a6]:43323 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:77527 |
Show key headers only | View raw
On Thu, Sep 4, 2014 at 1:22 PM, Rustom Mody <rustompmody@gmail.com> wrote: > | Effect-free programming > | -- Function calls have no side effects, facilitating compositional reasoning > | -- Variables are immutable, preventing unexpected changes to program data by other code > | -- Data can be freely aliased or copied without introducing unintended effects from mutation > > So to answer your question: print statements are side-effecting and therefore obstruct > compositional reasoning. Yeah, fine. One small problem: Computers aren't built to do nothing. "Effect-free programming" is utterly valueless and purposeless. To make a program actually useful, you need to have some effect somewhere. So where do you do that? Where do you permit a function with side effects? If you force *everything* to be in the return value, you lose any possibility of partial results - for instance, if it takes two weeks to render a ray-traced animation, you actually spend the entire two weeks building up a single, gigantic return value, which some outside system (which is presumably allowed to have side effects) then saves somewhere. In the meantime, you have absolutely no idea how far it's progressed - no information that it's completed frame 6 and is working on frame 7, nothing. Because telling the user anything is a side effect. And if my function f calls show_status_to_user() which has side effects, then f has side effects too, and you can no longer reason purely about f. The impurity that makes for practicality (hey, isn't there something in the Zen of Python about that?) pollutes upwards until all you'll have will be pockets of pure functional code that execute quickly enough to not need any intermediate output. That doesn't equate to "abolish print", that just means that you separate the guts from the UI - which is good advice for any system, no matter what its structure. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python is going to be hard Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-03 14:10 -0400
Re: Python is going to be hard John Gordon <gordon@panix.com> - 2014-09-03 18:17 +0000
Re: Python is going to be hard Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-03 14:52 -0400
Re: Python is going to be hard mm0fmf <none@mailinator.com> - 2014-09-03 22:37 +0100
Re: Python is going to be hard Rock Neurotiko <miguelglafuente@gmail.com> - 2014-09-03 20:16 +0200
Re: Python is going to be hard Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-09-03 11:19 -0700
Re: Python is going to be hard Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-03 14:50 -0400
Re: Python is going to be hard MRAB <python@mrabarnett.plus.com> - 2014-09-03 19:24 +0100
Re: Python is going to be hard Skip Montanaro <skip@pobox.com> - 2014-09-03 13:28 -0500
Re: Python is going to be hard Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-03 14:52 -0400
Re: Python is going to be hard Ethan Furman <ethan@stoneleaf.us> - 2014-09-03 11:33 -0700
Re: Python is going to be hard Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-03 14:41 -0400
Re: Python is going to be hard Ethan Furman <ethan@stoneleaf.us> - 2014-09-03 12:49 -0700
Re: Python is going to be hard Juan Christian <juan0christian@gmail.com> - 2014-09-03 15:44 -0300
Re: Python is going to be hard Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-03 14:56 -0400
Re: Python is going to be hard Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-03 14:49 -0400
Re: Python is going to be hard Ethan Furman <ethan@stoneleaf.us> - 2014-09-03 11:55 -0700
Re: Python is going to be hard Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-09-03 12:01 -0700
Re: Python is going to be hard Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-03 13:11 -0600
Re: Python is going to be hard Seymore4Head <Seymore4Head@Hotmail.invalid> - 2014-09-03 15:22 -0400
Re: Python is going to be hard Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-04 12:11 +1000
Re: Python is going to be hard Denis McMahon <denismfmcmahon@gmail.com> - 2014-09-03 20:55 +0000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-03 18:48 -0700
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-04 11:56 +1000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-03 19:10 -0700
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-04 12:25 +1000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-03 19:33 -0700
Re: Python is going to be hard alister <alister.nospam.ware@ntlworld.com> - 2014-09-04 10:29 +0000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-04 06:08 -0700
Re: Python is going to be hard Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-04 23:25 +1000
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-04 23:55 +1000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-03 20:22 -0700
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-04 13:49 +1000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-03 21:11 -0700
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-04 15:02 +1000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-03 23:23 -0700
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-04 16:39 +1000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-04 06:15 -0700
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-04 23:30 +1000
Re: Python is going to be hard Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-04 23:37 +1000
Re: Python is going to be hard Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-09-04 15:04 +0100
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-05 00:08 +1000
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-04 19:24 -0700
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-05 12:30 +1000
Re: Python is going to be hard Roy Smith <roy@panix.com> - 2014-09-04 22:51 -0400
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-04 19:56 -0700
Re: Python is going to be hard Chris Angelico <rosuav@gmail.com> - 2014-09-05 13:08 +1000
Re: Python is going to be hard Ethan Furman <ethan@stoneleaf.us> - 2014-09-03 21:06 -0700
Re: Python is going to be hard Rustom Mody <rustompmody@gmail.com> - 2014-09-03 21:15 -0700
csiph-web