3 ms·
I'm very tempted to explore a coding style in C and C++ using a more functional idiom. I think both languages could benefit greatly if made more transparently
by randcraw 9y ago
I'm very tempted to explore a coding style in C and C++ using a more functional idiom. I think both languages could benefit greatly if made more transparently 'intensional' -- more restricted use of in:out function arguments, explicit return variables, minimal pointer arithmetic, more explicit pointer expressions, etc.
Has anyone attempted to devise a FP-style guide for non-FP languages? It could be fun to reimagine their now-antiquated idioms spoken in a more intuitive and/or legible accent.
- crimsonalucard 9y agoJust make every variable immutable. That is the only style guide you need to make the program part of the fp paradigm. The rest of the "functional patterns" flow naturally out of this restriction.
- joncampbelldev 9y agoIf the standard data structures in your language are mutable this will not save you. Luckily many languages like Java have nice third party persistent collection libraries
- crimsonalucard 9y agoYou can treat the variables as immuteable even if they aren't...