Hacker News new | ask | show | jobs
by timbowen 6291 days ago
There is really no reason that I can see to try and figure out why API methods do what they do. You send it something, it sends what you want back. That's basically the nature of object oriented programming, and why it's so popular. You don't need to know the workings of an internal combustion engine to drive a car, and you don't need or want to know what your API is doing behind the scenes in my humble opinion.
2 comments

I think the obvious reason is that understanding why the API works as it does allows you to understand more about what your program is doing, and thus lets you write better software. For example, you can just think of malloc() as a magical "give me a block of memory!" API, which is perfectly sufficient for a novice who wants to write working programs. Alternatively, you can understand some (not all!) of the details behind virtual memory and how a typical heap allocator works. In the long run, that helps you write better software (e.g. by gaining an intuition for the relative costs of manual memory management, or debugging heap corruption).

So I think it's part of the difference between being a journeyman and an expert. That said, not all APIs are worth understanding, and you don't need to go into exhaustive detail with everything; it's a question of deciding what's worth learning in the long-run.

With frameworks, there's a design that it imposes on your application. Are you generally happy with an incomplete understanding of this design provided that your app seems to work?
what more can you ask for? regardless of whether you know how the system works, the nature of an API will impose certain things that you have to design with or around.