No, that wasn't the point of the argument. The point of the whole thing we were discussing was the absolutely liberal way in which some people just define, and redefine typedefs for one type, and think it's being done in the name of readability.
Using typedefs for practical type aliasing is, of course, obviously what typedef'ing was made for.
Unnecessary things like:
Code: Select all
//the person is trying to define an array of int, that stores, say, number of inventory items in stock for a grocery store.
typedef int grocery_items;
grocery_items stock[256];
Could, if made into a habit, become a serious harbour programmers other than the original developer. While this one use of ti doesn't seem so bad (although it is illogical), multiple typedefs of this kind, and even worse, compounded typedefs (typedef'ing typedefs into other aliases) can create a hazy, murky mess that others have to tread painstakingly through.
There's nothing wrong with the more normal approach:
But the examples you gave are all examples of the
proper use of typedefs.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.