News for hackers. Stuff that matters.
Re:How Class-based Programming Sucks (2011) by xcthulhu on Friday December 13, 2013 @09:14AM (#6900526)
Okay, for one:

1. Dynamically Typed Languages (LISP, Erlang, Smalltalk, Python, Ruby, and Javascript) are all easier than Haskell, JAVA, C++ or any other typed language for working with ADTs. Whether the language is OO or not isn't really relevant. On the other hand, you loose type-safety/efficient representations. But life is filled with choices, different tools are good for different things at different times.

2. You can have closures in a class based language. Here's some rather exotic Python code that uses both for measuring the performance of iterators: https://github.com/wearpants/measure_it/blob/master/measure_...

Smalltalk and Scala also have closures. It's not an either/or for classes vs. closures in programming language land.

3. There's more to concurrency than shared memory, so immutability is again a weapon that is good for some battles. If you have an app which you've factored into workers, unless they are on the same machine they'll need to communicate. Having your data be serializable is more important than having things be immutable in this context. What a worker does with data while it is handling it can involve lots of mutation.

So everyone should take a big breath, and remember that there's no one way to think about software and there's no universal rules, other than probably P != NP and stuff like that.

Re:How Class-based Programming Sucks (2011) by platz on Friday December 13, 2013 @10:12AM (#6900843)
At this point, it's probably easier to name the languages that don't have closures as opposed to those that do
Re:How Class-based Programming Sucks (2011) by EdwardDiego on Saturday December 14, 2013 @05:51PM (#6907456)
Java's anonymous classes can also act as a (large and bulky) closure, although as you have to declare local variables used by the anonymous class as final, the capacity to close over mutable state is limited to instance fields or mutable objects.