From the course: Python Data Analytics: From Notebooks to Production

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Module API

Module API

- [Instructor] When you restructure your code, you need a good API to your model, and here are several things that makes an API great. The first one is picking the right names, and this is really hard, right? There is a joke that says, "There are two hard problems in computer science, cache invalidation and naming things," and this is no joke. These two are really, really hard. And there is another joke on top of that joke that, "There are two hard problems in computer science, cache invalidation, naming things, and off-by-one errors." But naming, I spend a lot of time on naming, and sometimes, when you struggle with naming things, it's a sign that your design is somewhat off. The second thing is that your API should be self-explaining. If you look at this door, you know exactly what you need to do in order to open it. You need to push. It's not a door that you pull, and the same thing should go for your API. When you user sees a function, they should know exactly how to call it, what…

Contents