3 ms·
> APIs that do a bunch of magic for you are the opposite of simple You're mixing simplicity of API with simplicity of implementation. More often than not, you
by Const-me 7y ago
> APIs that do a bunch of magic for you are the opposite of simple
You're mixing simplicity of API with simplicity of implementation. More often than not, you can only have one but not both.
Modern Linux or Windows do huge amount of magic when you call kernel API like open (POSIX) / CreateFile (Windows), yet the API is simple and easy.
You can expose all implementation details, your code will be simple, but hard to build upon. Speaking about data storage, once upon a time I programmed Nintendo consoles, their file system API probably was very simple for Nintendo to implement, but using it wasn't fun: SDK documentation specified delays, specified how to deal with corrupt flash memory, etc.
You can do the other way, you'll have to do lot of work handling all the edge cases, your code will be very complex, but this way you might make a system that's actually useful. About data storage, SQL servers have tons of internal complexity, even sqlight does, but API, the SQL, is high level and easy to use even by non-programmers.