Cover by Marijn Haverbeke

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Interface Design

Designing an interface for a module or an object type is one of the subtler aspects of programming. Any nontrivial functionality can be exposed in different ways. Finding a way that works well is something of an art.

The best way to learn the value of good interface design is, unfortunately, to use bad interfaces. Once you get fed up with them, you’ll figure out a way to improve them and learn a lot in the process. Try not to assume that a lousy interface is “just the way it is.” Fix it, or wrap it in a new interface that is better (we will see an example of this in Chapter 10).

Predictability

If programmers can predict the way your interface works, they (or you) won’t need to look things up while working. Thus, try to follow conventions ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required