I Thought I Loved Functional Programming, but It Was Zig All Along
I have a bit of a history with functional programming. In fact, I wrote a functional programming library in C++ . Twice . The primary reason being that I was simultaneously fascinated with the intersection of functional programming which treats data as abstract values and the hard reality of how that code compiles into assembly and machine code. There are numerous reasons the concepts of functional programming are important to me. Functional code tends to be more terse, but the structure often does a better job of actually describing what the program does. Consider a program to print the numbers 0 through 10 inclusive with a newline between them in haskell. main = mapM_ (\x -> putStr (show x ++ "\n")) [0..10] In fairness to C++, I didn’t use print which automatically adds newline characters. Compare this to how you’d write this in C++, before the ranges library. For fairness, I’ll skip any boilerplate. for (size_t i = 0; i <= 10; ++i) { Std::cout << i ...