3 ms·
- High memory usage - Several patterns introduces a lot of boiler code. - It's harder to visualize a OO codebase than a pure FP codebase like Haskell. - Fram
by SpacePortKnight 4y ago
- High memory usage
- Several patterns introduces a lot of boiler code.
- It's harder to visualize a OO codebase than a pure FP codebase like Haskell.
- Frameworks like Spring / Jakarta are overly complex.
But I don't mind OO, it's just that after using Haskell and Python, it just feels a little messy.
- PaulHoule 4y agoWhat kind of stuff have you built in Haskell?
- Matthias247 4y ago> - High memory usage There is nothing about OO does enforce higher memory usage compared to other patterns. In fact it might be better than functional programming, which relies on a lot of closures (which all need heap allocations). The fact that Java does not support value types will require more memory for a certain set of applications than e.g. Go or C# - but that is barely related to OO. > - It's harder to visualize a OO codebase than a pure FP codebase like Haskell. This will be rather subjective. Be sure to have a common understanding with your team about it if you are not the only contributor to a codebase.
- pkolaczk 4y ago> There is nothing about OO does enforce higher memory usage compared to other patterns. Many OO languages offer dynamic/virtual dispatch of methods as a primary (and sometimes only) way to do polymorphism. This comes at a non-zero memory cost, because each object needs some additional runtime type information. > In fact it might be better than functional programming, which relies on a lot of closures (which all need heap allocations) Closures do not need heap allocations. Rust has closures and allocates them on the stack (unless you deliberately box them). I don't know Haskell, but I believe it could do the same.
- muzani 4y agoSounds like the exact use case for Kotlin.
- Gibbon1 4y agoYou might find you like C# better than Java then. C# has objects, structs, primitives. Sugar to get rid of boiler plate. And increasingly a lot of functional features.