Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'subject:Python': 0.06; 'sql.': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'toolkit': 0.09; '\xe2\x80\x94': 0.09; 'python': 0.11; 'language.': 0.14; 'finney': 0.16; 'incomplete': 0.16; 'lisp': 0.16; 'nevertheless': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'similarly,': 0.16; 'subject:Programming': 0.16; 'susceptible': 0.16; 'language': 0.16; 'fit': 0.20; 'programming': 0.22; 'header:User-Agent:1': 0.23; 'expanded': 0.24; 'sort': 0.25; 'header:X-Complaints-To:1': 0.27; 'correct': 0.29; 'nature': 0.30; 'programming.': 0.30; 'gives': 0.31; 'code': 0.31; 'relational': 0.31; 'writes:': 0.31; 'anyone': 0.31; 'another': 0.32; 'common': 0.35; 'tool': 0.35; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'programming,': 0.36; 'received:com.au': 0.36; 'scheme': 0.36; 'subject:one': 0.36; 'doing': 0.36; "didn't": 0.36; 'subject:?': 0.36; 'should': 0.36; 'so,': 0.37; 'problems': 0.38; 'ben': 0.38; 'to:addr:python- list': 0.38; 'rather': 0.38; 'functional': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'users': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'subject:Can': 0.60; 'back': 0.62; 'more': 0.64; 'techniques': 0.66; 'sam': 0.68; 'power': 0.76; 'exclusive': 0.81; '*and*': 0.84; 'received:125': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Can one use Python to learn and even apply Functional Programming? Date: Sun, 16 Feb 2014 16:42:34 +1100 References: <3fd33e3a-7774-4988-b725-4fed5472ac94@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: vmx15867.hosting24.com.au X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:wDNc8pr1UDLo3F1nvOJCOT+9EvI= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392529369 news.xs4all.nl 2842 [2001:888:2000:d::a6]:36059 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66509 Sam writes: > Some have advised me to use Haskell instead because Python is not a > good language for FP. There are some features of functional programming which are not a good fit with Python. By attempting to learn functional programming in Python, you will necessarily compromise your Python code *and* your understanding of functional programming. > I am sort of confused at the moment. Is Python a dysfunctional > programming language to apply FP? Can the more experienced Python > users advise? I think if you want to learn functional programming you should have a good reason for doing so, and you should learn something like Common Lisp or Scheme or another purely-functional language. You will definitely learn a lot about programming that you didn't know before, and be able to think about problems with an expanded mental toolkit. Similarly, I encourage anyone working with databases to learn correct relational database techniques — even though SQL is a deeply-flawed and rather incomplete tool for working with relational databases, nevertheless learning relational theory gives one an expanded mental toolkit for thinking about database design and access when working in SQL. Much of the functional programming toolkit will apply to your Python programming, but you will need to be aware of what tru functional programming is, and then bring that toolkit back to Python. -- \ “If nature has made any one thing less susceptible than all | `\ others of exclusive property, it is the action of the thinking | _o__) power called an idea” —Thomas Jefferson | Ben Finney