|
|
|
|
|
by jasode
3367 days ago
|
|
>It's only your opinion that the code is wrong based on the interpretation of the program's identifiers through an English dictionary. No, that isn't quite right. I'm the one who authored that code example so even if I used opaque non-English struct tag names such as "struct s1{}" and "struct s2{}" instead of "struct meter{}" and "struct inch{}", my brain intended for s1 and s2 to not be mixed and matched carelessly. Poster mikulas_florek suggested wrapping plain ints with a struct and my example shows that that workaround doesn't accomplish what he says it does. >It is well-defined ISO C. Yes, and I wanted to emphasize that truism by showing a live example of a successful compilation in ideone.com! I thought the thread was about higher-level semantics rather than the set of trivially true sequences of text input that the compiler accepts. |
|
Successful C compilation rarely means that only higher-level semantics not encoded into type system is now violated.
The battles in C are already being lost in the trenches of lower-level semantics.
If worrying about these higher level things and getting them right were the only problem in C development, C development would be in fantastic shape.
In safe languages which don't have type systems that can express pounds versus inches in inviolable ways, that sort of thing is rarely any sort of obstacle to real work; it's a fluff concern.
If I have to program in something which has no way of enforcing pounds being added to inches, and that is the only significant drawback of that language, I'm laughing.