Write less with typedef

Write less with typedef#

typedef struct {
  int x, y;
  char *name;
} Shape;
// An anonymous struct is shortened

Shape s;

typedef struct Node {
  char *data;
  struct Node *next;
} Node;
// Self-reference + tagged struct + typedef

Node n;

typedef struct {
  char *data;
  struct Node2 *next;
} Node2;
// Self-reference + anonymous struct + typedef
// ❌ don't do this. Even there is no error, it will error out eventually,
// because `struct Node2` is not defined. It is a forward declaration.

Node2 n2;

int main() {
  auto v = n2.data; // Not an error
  auto v2 =
      n2.next->data; // ❌ Error: Incomplete definition of `struct Node2`.
}