Hacker News new | ask | show | jobs
by deskamess 2342 days ago
Yes, learning other paradigms is useful.

For me, introducing immutability of data (functional paradigm) helped clean up many interfaces and made the code feel resilient. I realized I rarely passed the input data back to the caller (it was often a new and different structure). At the end of it all, I was somehow more confident in the 'run time' of the app and reasoning about issues is much easier. Currently I am not using any language features to enforce immutability - I just code the receiving function to not change any input structures (or in rare cases, return a new one). I suspect there are some exceptions lying around but having most of the code behave this way has helped.