3 ms·
wrt Picking and choosing, I think it's still possible to write code in an "FP" style (even just aesthetically) whenever possible or within (say) an OOP program
by mhh__ 7y ago
wrt Picking and choosing, I think it's still possible to write code in an "FP" style (even just aesthetically) whenever possible or within (say) an OOP program e.g. Abstract Syntax Trees map very well to OOP but the processing of them is very good for functional programming.
For example, I write in an SSA-like style whenever possible i.e. no variable reuse unless declared in loops. Keeping programs as pure as is reasonable can also do wonders for future multithreading even if slightly slower single-threaded.
I think an understanding of what a modern compiler will and won't do can improve the tradeoff between speed and readability (when present, I think optimization-theatre is quite common amongst low level programmers - based on my own biases)