C++, a language that includes not one, but three pure functional languages (preprocessor, templates, cosntexpr) and which uses two extensively throughout the standard library does ‘not encourage functional programming’? I think we might be using different languages.
I’d agree on the preprocessor but if you’re avoiding templates in C++ then you’re missing out on almost all of the power of the language. The absolute worst and most unmaintainable C++ code that I’ve read has been by people who avoid templates. Of course, the second worst is by people who over-use templates…
C++, a language that includes not one, but three pure functional languages (preprocessor, templates, cosntexpr) and which uses two extensively throughout the standard library does ‘not encourage functional programming’? I think we might be using different languages.
idk much about constexpr, but I try to use the preprocessor and templates as little as humanly possible in my C++ code. :-P
I’d agree on the preprocessor but if you’re avoiding templates in C++ then you’re missing out on almost all of the power of the language. The absolute worst and most unmaintainable C++ code that I’ve read has been by people who avoid templates. Of course, the second worst is by people who over-use templates…
You can redefine variables in the preprocessor, order matters,…
I think that I wouldn’t qualify it as “purely functional”
Note that this was originally published in April 2012.