Discussion Ask HN: Thoughts on adding utilities that aren't immediately needed? As a dummy example of what I'm trying to describe; imagine you need to write some utilities which can add or multiply numbers.So you write something likeclass CalculatorgetSum(v1, v2) getProduct(v1, v2)You don't have a use case for subtracting numbers. You expect this to be consumed by other teams, and it's plausible they will need to subtract.Do you add getDifference() or do you view that as bad practice? 3 points NotAnOtter 1 year ago 7 comments
So you write something like
class Calculator
getSum(v1, v2) getProduct(v1, v2)
You don't have a use case for subtracting numbers. You expect this to be consumed by other teams, and it's plausible they will need to subtract.
Do you add getDifference() or do you view that as bad practice?