[<<][c][>>][..]
Thu Jun 23 11:07:57 CEST 2011

Are structs bad?

The problem with C is not that structs are a bad interface, but that
it is hard to enforce structs to be immutable.

I.e. in essence there is not such a big difference between:

    struct foo {
        int a,b,c;
    };

and

    void foo (int a, int b, int c);

If any of the two interfaces changes, the code that uses it needs to
be changed anyway.

Of course, exposing _internal_ data structures that contain
implementation details that are irrelevant to the user is a a bad
idea.  I'm thinking mostly of structs as configuration files.




[Reply][About]
[<<][c][>>][..]