Functions vs OOP

Jean-Michel Pichavant jeanmichel at sequans.com
Mon Sep 5 21:04:37 CEST 2011


William Gill wrote:
>
> Not to split hairs, but syntactically f(x) is a function in many 
> programming paradigms.
>
> As I understand it functional programming places specific requirements 
> on functions, i.e.referential transparency.  So f(x) may or may not be 
> "functional".
>
> x.f() is also a function, but it is a member of the object x, is 
> referred to as a 'method' of x, and uses the syntactical "dot" 
> notation object"dot"function for identification.
>

Functional programming is not about writing a programm with functions 
(google it for more info). This may cause some confusion.

Your original post was about functions vs methods, which are identical 
except some syntax detail. FYI, in python x.f() is equivalent to f(x). 
In an OOP world one will  prefer the x.f() form.


JM






More information about the Python-list mailing list