Hacker News new | past | comments | ask | show | jobs | submit login

Problems can sneak in when you use the low-level API to do something to an object that can't be cleanly represented in the higher-level API. You need some kind of escape hatch, like a list of links to or ids of low-level details or a blob (Map<String,arbitrary-JSON> of miscellaneous data that can hold the low-level additions.

Hopefully the top-level important concepts like "amount_due" will still reflect the correct numbers!




Those problems usually present themselves by people overthinking the high level api and trying to be smart.

As an example, you can use chattr to make a file in Linux immutable. ls still shows that you have permission to write to the file, even though it will fail.

When people try to overthink the api and have it determine if you really can write to a file, people will try using the high level api first (chmod) and it won’t work because it has nothing to do with permissions.

KISS is really needed for high level APIs.




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

Search: