How does learning Haskell / Python harm a programmer?
From the translator:
I was pushed into this translation by another situation of “brain stupor” when writing banal code in C ++ / C #: I spent hours watching the ugly code, but could not make it really better;I just had to accept that only I saw it ugly, and that was my problem, not a problem in code or language.I remembered those times when there was no such thing with me - and at the same time I remembered this old article, the author of which suffered just like me, while writing well about it.
I found that learning Python and Haskell did not improve me as a programmer in other languages (which is contrary to what they sometimes write about it) . In particular, Haskell - being so unlike the imperative languages - in theory, should have given me an enlightenment in programming that would help me even without using any language at all. My current experience does not quite match this, and here's why:
Demotivation. ')
I noticed that I was thinking in Python and sometimes even in Haskell to some extent - even though I used Haskell quite a bit. I constantly find in myself a desire to use the idioms of these languages and count how much I could shorten the code if I used these languages (which, although very different from each other, are both much more powerful than the language I use at work - C #) . In most cases, this calculation shows that using any of these languages, I could reduce the size of my code by 2-5 times, and often 10-20 times for some parts of the code base.
Further, my experience with Haskell led to the fact that now I see potential bugs everywhere in the imperative code. Earlier, I was well aware of the problems growing out of stateful programming and side effects - I myself faced with a large number of similar bugs and spending countless hours in debugging. But with no alternative, I just lived with it. Now, knowing that there are other ways to solve the same problems - I find it difficult to be satisfied with any of my code. I am constantly worried that I am writing traps into which other people are likely to fall.
I also find the C # code quite ugly compared to Python and Haskell. At the visual level, the obligatory use of brackets (well, not always mandatory, but coding standards usually do not encourage this) makes the code very noisy and sparse, and combined with the rigor and verbosity of libraries — you find that the whole C # 'a page is common something does nothing. And if we talk about beauty at the mathematical level, the C # code is just a clumsy earthen hut compared to the elegant Haskell code spire.
All these factors add up to depress me and demoralize me. I feel like a compiler translating from Haskell or Python, which is in my head, into a language that is a whole level lower.