It's unfortunate that the learning curve to get to monads is really, really steep. But when you're there, it's just nice.
Recommended reading and recommended blog: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/ … by @BartoszMilewski :)
-
-
This. Haskell is hard because programming is hard. Primitives in Haskell as a side effect (pun) also teach concepts like managing state, which usually takes years to develop. Path of least resistance in Haskell is managed state. Path of least resistance in Imp. is global state.
2 replies 0 retweets 1 like -
Just like most bad things in CS, this line of thinking starts with an idea that is true, but then extrapolates it waaaaay beyond the place where it is beneficial into a realm of total lose.
0 replies 0 retweets 7 likes -
This Tweet is unavailable.
-
But, manipulating global state is how your computer actually works. Pretending that that is inherently bad will only lead you to a sad place. At the same time, yes, unnecessary global state makes things confusing. But the right amount of global state is a good idea.
2 replies 0 retweets 9 likes -
But how much global state is good? I mean, you let some global state in, and before you know it, it starts taking over your whole life. It keeps making demands, asking for special treatment, setting up rules. I don't know--maybe the sad place is all we have.
2 replies 1 retweet 4 likes -
I addressed this earlier in the thread. The amount of global state that is good is the amount natural to your problem. More is bad, but less is also bad. Pretending not to need state, when you really do, is just obfuscating your program.
1 reply 0 retweets 7 likes -
Replying to @Jonathan_Blow @BartoszMilewski and
But, you know, I am willing to admit if I am wrong. If you want to tell me how to render something like Apex Legends at 240Hz without using global state such as texture maps in GPU memory, in such a way that the program is cleaner and simpler, I will definitely listen.
1 reply 0 retweets 6 likes -
Purity ends there, meaningfully. You'd still upload data to the GPU, and the most toplevel part of your rendering code needs live in the IO monad.
1 reply 0 retweets 1 like -
Ends where exactly? Texture maps are 1 of many things I can name without even pausing to think about it.
2 replies 0 retweets 4 likes
But the real answer is ... try it and show me? You have many many examples of programs that do this by explicitly manipulating state. How about making just one example that is competitive while being stateless? Just one?
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.