4 ms·
Not really redundant when you can curry the function when needed. This is how libraries in functional languages are written. Classes make code harder to reason
by tkahn6 15y ago
Not really redundant when you can curry the function when needed. This is how libraries in functional languages are written. Classes make code harder to reason about given that you have hidden state everywhere.
- kingkilr 15y agoDo you think a closure isn't state?
- jrockway 15y agoHe does, but he feels smarter if he emulates something everyone already does in a more obscure manner. Yesterday, I derived an n-algebra for feeding my cat. See how smart I am!? (The reality is simple. Classes are Python's state-capture abstraction. Using a bunch of lambdas to do the same thing means you are writing Haskell in Python, which is a dumb thing to do, because while the computer knows what you want, other programmers don't. If you want to use Haskell, use Haskell.)
- deleted 15y ago[deleted]
- tkahn6 15y agoOuch. No need to be condescending, Jon. When I write Python, I use classes and magic methods and all that jazz. Programming in a functional style in Python is often verbose and brittle due to the duck-typing. I was under the impression we were talking about programming in general.
- funkah 15y agoHa, precisely.
- omaranto 15y agoI don't think the point was that this wasn't state, but that it's not hidden state if you explicitly pass needed data as parameters.
- Drbble 15y agoYeah but the debate topic is "don't use classes", not "use Haskell" or "write in a unary lambda style"