4 ms·
Is it, though? How do you know? Don't get me wrong, I think so too, it's just that I've begun doubting myself. I've always thought it worthwhile to learn very
by anatoly 13y ago
Is it, though? How do you know?
Don't get me wrong, I think so too, it's just that I've begun doubting myself. I've always thought it worthwhile to learn very different languages for the mind-opening effects of their paradigms. But it's become clearer to me that beyond the warm and fuzzy feeling of understanding ways to package and handle state in pure FP languages, I lack any specific evidence that learning Haskell helped my programming style or effectiveness in mainstream languages.
How would I go about finding such evidence?
To put it in a brutally reductive form: I looked at my C++ code before and after I learned Haskell and played with it a fair amount. I didn't see much difference, though maybe I didn't look at the right things?
- awj 13y agoJohn Carmack took Haskell out for a spin in 2013 and had a good take-away from it. I don't have any sources to link, but I remember quite a few comments from him on twitter about how he got almost nothing but benefits the harder he leaned on const correctness in C++. And that this inclination came from his experience with immutable data in Haskell.
- BadassFractal 13y agoA good chunk of his 2013 keynote was a praise to Haskell.
- wting 13y ago> "Functional Programming in C++" > My pragmatic summary: A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in. In a multithreaded environment, the lack of understanding and the resulting problems are greatly amplified, almost to the point of panic if you are paying attention. Programming in a functional style makes the state presented to your code explicit, which makes it much easier to reason about, and, in a completely pure system, makes thread race conditions impossible. > I do believe that there is real value in pursuing functional programming, but it would be irresponsible to exhort everyone to abandon their C++ compilers and start coding in Lisp, Haskell, or, to be blunt, any other fringe language. To the eternal chagrin of language designers, there are plenty of externalities that can overwhelm the benefits of a language, and game development has more than most fields. We have cross platform issues, proprietary tool chains, certification gates, licensed technologies, and stringent performance requirements on top of the issues with legacy codebases and workforce availability that everyone faces. > If you are in circumstances where you can undertake significant development work in a non-mainstream language, I’ll cheer you on, but be prepared to take some hits in the name of progress. For everyone else: No matter what language you work in, programming in a functional style provides benefits. You should do it whenever it is convenient, and you should think hard about the decision when it isn’t convenient. -- John Carmack (http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/ http://www.altdevblogaday.com/2012/04/26/functional-programm...)