DEV Community

Discussion on: When to choose purely functional programming?

Collapse
 
kspeakman profile image
Kasey Speakman

Use pure functions when you want it to be maintainable. Use OO if that fits your mental model or enjoyment better. In most cases, performance will be good enough. Or at worst, you might have to optimize some fringe cases over time.

If performance is your goal, then it is exceedingly difficult to beat imperative/procedural written by someone who understands how the language works internally. They are basically bypassing the language and writing code to match the hardware constraints.