Comment Re:C has bigger problems than that trivia (Score 1) 729
Null terminated strings are a bigger problem. What do you do if you want to embed nulls in a string? Not use the entire string.h library for starters, have to write your own routines.
Yes. Because those are different constructs. Live with the fact that both are useful.
Having the length makes a strlen function trivial and run in constant time
And having a hash makes ==/=! run in constant time most of the time. And then you could also add an indicator for encoding. And some flags for the garbage collector or if not that at least a COW flag. And then suddenly you find you're using more than a cache line for just one variable in a critical code section even when you're pabsolutely sure the string can only contain "TRUE" or "FALSE". And that is part of why my applications seem to run slower and slower every year despite my hardware being upgraded.
Personally I prefer functions to use parens. Like in math. It makes sense visually and keeps things organized. Are you allergic to the shift key or something, or do you just enjoy the mental challenge of parsing things in your head. You'd seriously prefer this:
thingA thingB thingC,4,7,thingD thingE
to this:
thingA(thingB(thingC(4,7)),thingD(thingE))
?
For which one do you have to consult the documentation, if even extant, to figure out the arity of things?