logoalt Hacker News

teo_zero12/09/20241 replyview on HN

Right. It would be nice if C allowed types and variables to be separated, we could even defines arrays like this:

  char[8] buffer;
Alas, it's not the syntax Dennis Ritchie settled upon.

Replies

cb32112/09/2024

The trade-off is one vs. two operator sub-syntaxes or in other words "sub-syntax economy". As it is, C has just one operator expression syntax (and one set of operator precedences/associativities). The "forward applicative" expression syntax is "reused" in the "backward" or "inverse" type declarations.