logoalt Hacker News

silvestrov • today at 12:23 PM • 1 reply • view on HN

I think C and C++ always have suffered from wanting to support all kinds of weird architectures like 9 bit bytes and 80286 style segmented memory. So many people see this as a virtue rather than restricting the usefulness of C.

So char always means "byte" and never a real character. I don't think many C programs will work well if char is a 32 bit type so it supports full unicode.

int8_t came way too late and has a way too long name. It should be i8 or int8. There is a problem when C is more verbose than Java. Also: why did it take so long to get a boolean type and fix the "bools are ints" design mistake.

Lack of standard libraries and module system is just another layer of not wanting to standardize things.


Replies

foldr • today at 12:56 PM

>I don't think many C programs will work well if char is a 32 bit type so it supports full unicode.

That's not really how unicode support works. It can be useful to have a specific type for storing unicode code points (like Go's 'rune' type), but strings are generally UTF-8 encoded these days, so having a wide char type plays at most a marginal role in a language's unicode support.