News for hackers. Stuff that matters.
Re:Why I'm Productive in Clojure by jcromartie on Wednesday July 23, 2014 @11:08AM (#8074732)
I use Clojure a lot, and did more Python in the past. Whenever I come back to Python, I am frustrated by being unable to remember what's a plain old function and what's a method, and the differences defining functions vs classes and methods etc..

In Clojure I know it's always (except for interop) just functions on values. Some functions dispatch to an implementation based on the type of the value, as is the case with multimethods and protocols, but it's still always just function calls from my point of view while writing the code.

Re:Why I'm Productive in Clojure by scardine on Wednesday July 23, 2014 @12:57PM (#8075428)
Objects in Python little more than glorified namespaces. I always think of methods as a function that gets the namespace where it was declared as the first argument. Yes, there is the inheritance thing, but in Python it is just a mechanism to organize code.
Re:Why I'm Productive in Clojure by mimighost on Wednesday July 23, 2014 @01:03PM (#8075469)
In general, Python method is just combination of function object and pointer to "self" namespace.
Re:Why I'm Productive in Clojure by agumonkey on Wednesday July 23, 2014 @03:34PM (#8076470)
I'd like to know if it's done differently in other languages. In my view, methods are curried function over self with a '.' syntactic shortcut.
Re:Why I'm Productive in Clojure by kazagistar on Saturday July 26, 2014 @03:07AM (#8089131)
Lua does not do the currying bit, but it does a lot less OOP and a lot more "dictionaries with stuff that can do something like prototype OOP if you squint hard enough". Java and whatnot just don't let you really use methods as first class citizens, so it doesn't matter.
Re:Why I'm Productive in Clojure by agumonkey on Monday July 28, 2014 @03:43AM (#8095607)
IIRC under the hood Java will 'evaluate' the methods body as a sophisticated function with 'this' in its environment.
Re:Why I'm Productive in Clojure by collyw on Thursday July 24, 2014 @07:56AM (#8079099)
That's pretty much how I view them as well.
Re:Why I'm Productive in Clojure by agumonkey on Friday July 25, 2014 @08:14AM (#8084769)
Great then.