Hacker News new | ask | show | jobs
by Terr_ 673 days ago
That feels like unnecessary levels of indirection to provide a method that shouldn't be on the User anyway.

    j = Jurisdiction.fromUserLocation(user);
    j.isOfDrinkingAge(user);
1 comments

> that shouldn't be on the User anyway.

That’s just your opinion. It’s ok to provide convenience functions. I see no difference between the amount of indirection in our implementations, except mine is in the more natural place and you don’t have to know how to get a location or jurisdiction to answer the question: “is this user an adult?”. Knowing that it uses a location or jurisdiction is an implementation detail that you shouldn’t couple yourself to.

Cheers mate, I think I’m done moving goal posts for this conversation :)