4 ms·
C pet peeve: typedef structures for_incredibly_esoteric_type_t.
by zump 10y ago
C pet peeve: typedef structures for_incredibly_esoteric_type_t.
- bluetomcat 10y agoI too hate typedef except for integer/FP types where the new name would carry semantics, like, for example, `pid_t` or `time_t`. `point_t` instead of `struct point`, `color_t` instead of `enum color` or worse, `pint` instead of `int *` is stinky because it hides the actual operations which are only applicable to a struct, an enum, or a pointer, respectively.
- astrange 10y agoI've noticed a lot of people like to end their types in _t, maybe because it looks cool, but POSIX actually says all those names are reserved for the system. Oh well. http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2...