Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C pet peeve: typedef structures for_incredibly_esoteric_type_t.


I'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...


I 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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: