3 ms·
> On the other hand, if my API had a different input type for each country's tax ID, Then you've significantly increased the work (and opportunity for bugs) re
by jfrunyon 5y ago
> On the other hand, if my API had a different input type for each country's tax ID,
Then you've significantly increased the work (and opportunity for bugs) required of a downstream programmer, and also made it significantly more likely that they won't support all countries, and of course they could also still send the wrong type...
- kazinator 5y agoPlus, this stuff likely has to go into a database. Now we have polymorphic OOP stuff needing to be connected to records and fields in a table. Maybe just have a generic "taxblob" fields which is a serialized object which indicates its type and all the properties by name.