Comment

Comment by bluetomcat

> Wrap your structs in a typedef

I tend to disagree. Unless you are providing an API for third-party use and want to make your data types opaque to callers, do not ever use typedef with structs and pointers. A declaration like "struct foo *f" tells you two things - f itself is a pointer, and the pointed-to value is not a scalar (i.e. has named members). The "_t" suffix idiom is predominantly used by the standard library for integral scalars with certain properties and semantics, e.g. pid_t, uid_t, gid_t, time_t.

parent bluetomcat 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton