I've heard it many times: when someone tried to introduce Haskell to people with backgrounds in other programming languages, statements like these flowed:
X in Haskell is like Y in other languages, but better
Z in Haskell is similar to V in other languages, but more powerful
An example so that it does not look like empty words:
Many people who come from OOP are confused with type classes because they believe they are like classes in object-oriented languages. Well, they are not. You can think of them as Java interfaces, but better.
Some time ago, this kind of attitude used to bother me and was a sure way to make me reject anything that was proposed. Therefore, due to Haskell's constant claims of superiority over other languages, I was not trying to learn Haskell … until now, when I have to, thanks to the Dear Academy.
However, recently I began to seriously think that my approach was arrogant and was only hurting me. Maybe Haskell is really superior, I just refuse to accept it.
Well, there are fields in which Haskell can not compete, as it is likely to never be faster or provide more control than C or Assembly. But what about C # or Java or the likes?
Another thing is that Haskell has a high entry barrier. But again, the correct patterns and principles in C #, Java, Python, etc. they also have a higher entry barrier than the simple and naive coding of cowboys. The use of dependency injection, for example, is more complicated than global and static spamming; TDD (another thing I used to reject in my arrogance because I was being pushed so hard) requires considerable time to learn. Finally, it would seem that functional programming is making its way into OO languages, but again, it seems less intuitive than the modification of the state.
Therefore, it would seem that:
- One can, without much effort, encode in typical general purpose languages, such as C #, Java, Python, etc., plaguing the code with anti-patterns, the results will be bad
- One needs a lot of time and effort to learn coding correctly In these languages, the results will be good.
- One needs a lot of time and effort to code absolutely in Haskell; However, once one learns this, the results will be excellent.
Haskell, therefore, is only slowed by its high barrier to entry? (And perhaps a less rich collection of libraries, compared to the most adopted languages). However, once one is not hindered by the lack of necessary libraries, he is not afraid of the high entry barrier and the scope of the project does not require the use of low level languages such as C or even assembly. Is Haskell the best choice without ambiguities?