←back to thread

71 points susam | 2 comments | | HN request time: 1.34s | source
Show context
EVa5I7bHFq9mnYK ◴[] No.43674213[source]
Some of his grievances:

Lack of external static storage class, the pinnacle of C programming.

Lack of oh so powerful C strings, terminating in zero (hopefully).

"There is no way to override the type mechanism when necessary, nothing analogous to the "cast" mechanism in C."

"begin" and "end" are bulky compared to { and }.

replies(3): >>43674293 #>>43675646 #>>43675815 #
1. citrin_ru ◴[] No.43675646[source]
Null-terminated strings is an endless source of bugs in C progras. I with C used fixed size strings (may be with varint instead of 8-bit length field) or Pascal got more tratcion.
replies(1): >>43675844 #
2. ziml77 ◴[] No.43675844[source]
And very annoyingly they can't be sliced except if you are only trimming off the front. If you need to chop off anything at the end, you either need to make a copy or do an icky and not thread safe hack of swapping out a character for the null character and then swapping it back when you're done.