Envoy interview question

why use typedefs?

Interview Answer

Anonymous

20 Nov 2016

I blanked out and blurted out a bad assumption that typedefs used by the compiler to protect type safety. The correct answer I didn't give was: typedefs create aliases to existing types and provide clarity and portability to interface definitions. These are used in C, C++ and Objective-C. For Swift, the same thing can be accomplished with typealiases.