by Swizec · 5y ago · 0 comments
But maybe the past 10 years of functional-ish programming have broken me. There are lots of problem areas where objects fit nicely. Actor based programming is very elegant with classes and objects I think.
Modern multi-paradigm languages are great because you can use classes when classes are the right thing, and functional programming when that's the right thing.
Classes are a great tool, but not the only tool.
There doesn't seem to be an either/or situation when using CLOS in Common Lisp.
1. Implementation inheritance creates brittle, tightly coupled and difficult to test code.
2. Mutable classes force you to structure data updates in a particular, inflexible way. In a world where you're sharing data across multiple clients, serializing and deserializing, using things like Redux to structure updates etc this creates a huge amount of internal friction.
My class-based solutions are more prone to failure than other solutions I've used before. It always gets more complex than it should.