Pure functions are often hyped up in the JavaScript world, probably because of the abundance of stateful front end applications. While pure functions have their downsides (i.e. inconvenience, potentially large argument lists), they should be used as much as reasonably possible.
We’ve made a lot of changes in the Qvault app codebase recently to use more pure functions, and it has helped make the code easier to understand and write tests for.
According to Wikipedia, a Pure function has the following properties:
Which means that as a developer I know two important things:
#golang #clean code #engineering practices #languages #go #golang #programming #pure functions #testing