[Haskell-cafe] [OT] thoughts about OO vs. functional "philosophy"
aquagnu at gmail.com
Mon Mar 11 10:55:29 UTC 2019
11.03.2019 09:51, Damien Mattei wrote:
> a method of a class you always have to instantiate an object...
not always, static methods do not need this.
> so after another people reading your code will say, "hey what's all
this mess?" , and you're code will be hard to read , and even for you
when making big program you will have tons of classes, inheritance and
will move in a maze of classes!!! a nightmare.... sometimes, i
experienced it! at the opposite functional programming is so easy, so
clear for your mind.
Absolutely no matter what you slice the code: functions in modules or
methods in classes. In Haskell we also have a lot of functions, modules,
types, etc. But the cause of the complexity is not linked directly to
the number of entities (and in most cases it's not): programming in
Smalltalk/Java/VB/Python/etc is simple and fast and increasing of the
number of used classes and methods does not need more specific knowledge
of the language and can be done by newbie who already knows the syntax,
as you said it before - it's enough to instantiate the object and to
call some its method! By the way, Smalltalk, as I know, even has not DI
- I suppose due to image :)
And this is false for Haskell: it's not enough to know language syntax
(it's relatively simple): each library can involve own level of
abstraction, own eDSLs, etc. And if somebody built his library on
arrows, pipes, free monads, etc - it's not enough to know language's
syntax only. Imagine a big house built with simple and same bricks. And
some Baroque theater where anything is complex and unique.
So, languages like Haskell are more complex and need more time to learn
and create valuable applications.
More information about the Haskell-Cafe