News for hackers. Stuff that matters.
Re:Can I do FP in my language? by randcraw on Saturday August 05, 2017 @12:25PM (#14936460)
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.

Re:Can I do FP in my language? by crimsonalucard on Saturday August 05, 2017 @12:42PM (#14936552)
Just 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.
Re:Can I do FP in my language? by joncampbelldev on Saturday August 05, 2017 @03:49PM (#14937539)
If 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
Re:Can I do FP in my language? by crimsonalucard on Saturday August 05, 2017 @04:12PM (#14937642)
You can treat the variables as immuteable even if they aren't...