30+ years of tech, retired from an identity intelligence company, now part-time with an insurance broker.
Dev community mod - mostly light gardening & weeding out spam :)
Couple of thoughts while reading this excellent article Maciej:
Functional core, imperative shell: is a whole-application design ethos that you are not suggesting we break (thanks!), which differs in scale from your examples here of perfectly legitimate mutation within a method/function, however...
Internal mutation falls apart if others can attempt to extend/get-inside a thing, this largely impacts next-scale up entities such as classes or libraries that expose the state.
Ensuring that referential transparency is maintained is harder to prove when mutating anything, neat/efficient it may be, but proving it's safe for missile guidance may be harder :)
I am Software Developer, currently interested in static type languages (TypeScript, Elm, ReScript) mostly in the frontend land, but working actively in Python also. I am available for mentoring.
Internal mutation falls apart if others can attempt to extend/get-inside
Extending function is not a common practice in FP. We more should strive for small replaceable units. Instead of adding new use cases to the unit we should compose it with another. Until we keep them small even imperative code should not be any issue.
Ensuring that referential transparency is maintained is harder to prove
Again the same counter argument from my side. Until we keep functions small with one responsibility, nothing like that should happen.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Couple of thoughts while reading this excellent article Maciej:
Hi Phil,
Thanks for the comment.
Extending function is not a common practice in FP. We more should strive for small replaceable units. Instead of adding new use cases to the unit we should compose it with another. Until we keep them small even imperative code should not be any issue.
Again the same counter argument from my side. Until we keep functions small with one responsibility, nothing like that should happen.