Creating Your Own Types (Type Aliasing)

Creating Your Own Types (Type Aliasing)

Programmer-defined data types are one of the most powerful capabilities a language can give you to clarify your understanding of a program. They protect your program against unforeseen changes and make it easier to read—all without requiring you to design, construct, or test new classes. If you're using C, C++, or another language that allows user-defined types, take advantage of them!

Cross-Reference

In many cases, it's better to create a class than to create a simple data type. For details, see Chapter 6.

To appreciate the power of type creation, suppose you're writing a program to convert coordinates in an ...

Get Code Complete, 2nd Edition 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.