Ok semantics aside, any function not doing just one thing is violation of single responsibility pattern. It is immediate technical debt. It's a code smell/anti pattern. The solution: Chaining pure functions each doing their own thing.
Single responsibility principle, like pure functions, are highly suggested. It is understood and usually suggested that you only stick to the principles when it makes sense. Which is not every scenario.
It is immediate technical debt. It's a code smell/anti patter
This is just your opinion. Other people may have another
Ok semantics aside
Semantics is meaning. If we are not talking about meaning, what are we talking about?
Pure function can do one thing, but as well can do many things, it will not change it's pureness.
This is core idea of pure functions, you can combine them and as the result you get new pure function (which is not doing "one thing" anymore). Pureness is about absence of side effects.
On the other function method in object can have single responsibility but the same time it can do some side effect, e.g. it will not seamlessly compose.
..this is the core idea of pure functions... yes composition at it's best.
Yes my opinions are strong on single responsibility, indeed and I stick by them. Notice I never made mention of side effects, that's a whole different topic.
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.
Ok semantics aside, any function not doing just one thing is violation of single responsibility pattern. It is immediate technical debt. It's a code smell/anti pattern. The solution: Chaining pure functions each doing their own thing.
Single responsibility principle, like pure functions, are highly suggested. It is understood and usually suggested that you only stick to the principles when it makes sense. Which is not every scenario.
True..
This is just your opinion. Other people may have another
Semantics is meaning. If we are not talking about meaning, what are we talking about?
Pure function can do one thing, but as well can do many things, it will not change it's pureness.
This is core idea of pure functions, you can combine them and as the result you get new pure function (which is not doing "one thing" anymore). Pureness is about absence of side effects.
On the other function method in object can have single responsibility but the same time it can do some side effect, e.g. it will not seamlessly compose.
..this is the core idea of pure functions... yes composition at it's best.
Yes my opinions are strong on single responsibility, indeed and I stick by them. Notice I never made mention of side effects, that's a whole different topic.