Hacker News new | ask | show | jobs
by blix 1215 days ago
Calling C's type system 'limited' is asking it to be something that it's not. A skateboard isn't limited because it doesn't have a steering wheel and airbag; if it did it wouldn't be a skateboard.

C's type system is different enough in scope and goals from many other type systems that it leads to confusion to lump them together. That's really what this article is about. The author has miscalibrated expectations.

1 comments

> The author has miscalibrated expectations.

No, they don’t. Nobody expects to dive into a C program and find that every single function parameter is a void*. That’s just abusive. Yea, the language technically allows it, but it eliminates all possibility of effective cooperation between developers.

> C's type system is different enough in scope and goals from many other type systems that it leads to confusion to lump them together.

C does have a type system, it makes C better than languages without one (like assembler), and faulting C for not incorporating ideas invented in the decades after C was invented is also abusive. Claiming that it isn’t good enough to be called “a type system” is just an attempt to change the language so that you are always right.

The difference between

    function(void *pointer) { 
      data_type *argument = pointer;
      ...
    }
and

    function(data_type *argument) { 
      ...
    }
is really small. If this hurdle is enough to 'eliminate all possibility of cooperation,' there was no possiblity in the first place.