Re: [hackers] [quark] Use sizeof() instead of magic constants || FRIGN

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Tue, 6 Sep 2016 10:35:17 -0700

On Mon, Sep 5, 2016 at 12:41 AM, FRIGN <dev_AT_frign.de> wrote:
> but this only happens if you typedef your structs, which I think is bad
> practice.
> If you do a
> #typedef struct hw homework
> this is your own fault. Using
> sizeof(struct hw)
> shows clearly it's a type, whereas
> sizeof(homework)
> is not clear. But this is more a criticism of extreme typedeffing. Stop
> using typedefs for structs and you won't have this problem any more. If
> you can't discern type names from variable names, this is your problem.

The style guide, which follows from "Unix Programming Environment,"
says to capitalize typedef names. In this way user defined types start
with a capital letter and all builtin types, variables, functions
start with a lower case letter.
Received on Tue Sep 06 2016 - 19:35:17 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 06 2016 - 19:36:14 CEST