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.
Yes sure, you are right. In this situation the win is arguable, as the logic is very simple. So for sure I would not make it important so much if this check happens few times, even more if we have static types to support us with this check. But if this check is notorious in the app, and if it is connected with others it is better to abstract it.
For sure examples I made in the article are very simple (maybe even too much). But if we would have some && || copy pasted, so some combined logic then such abstraction would be far more valid.
Thanks for comment!
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.
Yes sure, you are right. In this situation the win is arguable, as the logic is very simple. So for sure I would not make it important so much if this check happens few times, even more if we have static types to support us with this check. But if this check is notorious in the app, and if it is connected with others it is better to abstract it.
For sure examples I made in the article are very simple (maybe even too much). But if we would have some && || copy pasted, so some combined logic then such abstraction would be far more valid.
Thanks for comment!