Hacker News new | ask | show | jobs
by makeitdouble 261 days ago
But then the function x data mapping isn't 1 to 1 in most cases, which is often why inheritance is used.

IMHO sperating data formats and functions works decently enough, interface/protocol/duck typing are more elegant than OO classes.

As a real world image, a barcode scanner could be applied to anything that has a barcode, regardless of what that thing is. And I'd wager 99% of what we're trying to do fits that mold. When authentifying a user, the things that matter will be wether it's a legitimate call, and whether the user is valid. Forcing that logic I to classes or filtering by use type quicky becomes noise IMHO.