Essay 35Teach with Obvious Examples

For newbies, good examples are devoid of abstractions. They are concrete and clearly—almost too clearly—convey the intentions of what we’re teaching. They provide good context.

On the other hand, poor examples are littered with abstractions and vague differentiations. Here’s a classic case of such an example.

When Clarity Met Sally

Imagine we’re teaching a beginning programmer the basics of object-oriented programming. We might start, naturally, by discussing class constructors and object instantiation. At some point in our talk, we scribble a line of code like this:

 
Object myObject = new Object();

For us, this is a ho-hum line of example code. It says to create an instance of an object of type Object ...

Get The Developer's Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.