2 months ago
Mon May 5, 2025 6:22pm PST
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 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?

comments:
add comment
loading comments...