Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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...



Plus, 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.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: