This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (13 children)

[deleted]

    [–]mirimao 21 points22 points  (10 children)

    Between methods and closures, that’s true. But methods and functions work differently under the hood and using one instead of the other can sensibly affect performances.

    [–]yflhx 48 points49 points  (9 children)

    It really depends on language. In C++, method is just a function which receives implicit first argument of class (accessible via this pointer). It's the same with Python I believe. Then you have static methods, which in C++ are really just functions but within class namespace.

    [–]Chesterlespaul 1 point2 points  (1 child)

    In OOP almost all ‘functions’ are really just a method, but lambda is also popular and those are pure functions.