Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'skip': 0.04; 'interpreter': 0.07; 'python': 0.08; 'output': 0.10; 'am,': 0.12; 'structures': 0.15; 'bullet': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'require.': 0.16; 'result;': 0.16; 'subject:OOP': 0.16; 'mon,': 0.16; 'wrote:': 0.16; 'received:209.85.210.174': 0.18; 'received:mail- iy0-f174.google.com': 0.18; 'suggest': 0.20; 'so.': 0.22; 'header :In-Reply-To:1': 0.22; "one's": 0.23; 'sep': 0.23; 'starts': 0.24; '"this': 0.24; 'explains': 0.24; 'code,': 0.28; 'message- id:@mail.gmail.com': 0.29; 'updated': 0.29; 'second': 0.29; 'url:dev': 0.30; 'functional': 0.31; 'list': 0.32; 'does': 0.32; 'to:addr:python-list': 0.33; 'pretty': 0.35; 'url:python': 0.36; 'skip:" 10': 0.36; 'depend': 0.37; 'using': 0.37; 'run': 0.37; 'but': 0.37; 'somewhat': 0.38; 'steven': 0.38; 'received:google.com': 0.38; 'url:org': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'under': 0.39; 'url:docs': 0.39; 'basic': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; "i'd": 0.40; "it's": 0.40; 'more': 0.60; 'charset:windows-1252': 0.60; 'concept': 0.72; 'prefers': 0.84; 'invite': 0.89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=a52IEkZfURiEUrowpFmW4ixkMObYN7UofWUUlfnKWUw=; b=xNgRfGK5wGfJ7qtTXax+1mnYWGVTcFAvLSRuCu0Ucv9/W7YYJUH2fGG368EZbdCoCT 0iHDZfLTmB2irXsd37ujMcFm33VhZYpMOKG1tIYdi3QReIbRXXZbgAjVkNe0RjgKLJKQ jhz6b2M4YEAyXR2c5GLZafq4bJD5QivIAOSRo= MIME-Version: 1.0 In-Reply-To: <4e640cb7$0$30003$c3e8da3$5496439d@news.astraweb.com> References: <4e640cb7$0$30003$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 5 Sep 2011 10:59:59 +1000 Subject: Re: Functions vs OOP From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315184402 news.xs4all.nl 2446 [2001:888:2000:d::a6]:49718 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12756 On Mon, Sep 5, 2011 at 9:41 AM, Steven D'Aprano wrote: > http://docs.python.org/dev/howto/functional.html > > What about the entire "Introduction" section, which starts with this > statement? > > "This section explains the basic concept of functional programming" > > If you would like to suggest improvements, please do so. Well, it does invite you to skip that whole section :) Since you asked, though, the copyeditor in me does want to suggest one small tweak: Second paragraph after the bullet list ends "Avoiding side effects means not using data structures that get updated as a program runs; every function=92s output must only depend on its input." - I'd word it as "must depend only on". Pretty immaterial, but the formal style prefers correctness. Somewhat more significant: Under "Modularity", may be of value to add a paragraph about parallelism. With functional code, it's easy for an interpreter to ascertain which functions depend on each other (because one's return value is another's input). Independent functions can be run in parallel without affecting the result; the interpreter can therefore divide a complex task across multiple CPUs without any work from the programmer. Like I said, it's just "since you asked". :) The above paragraph is hereby given out as public domain, use it (edit it, whatever) under whatever license the Python docs require. ChrisA