4 ms·
C is not just a bad language. It is a demonic instrument
- jqpabc123 3y agoC is a language designed for resource constrained computing --- efficiency over safety and security. The computing landscape has changed a lot since C was created.
- rurban 3y agoAnd what about the most basic operations: add and mult? Impossible to do in C properly, without overflow. Not talking about type-unsafety, memory-unsafety, a kids stdlib and language specs with undefined behavior all over. It's a joke.
- trealira 3y agoC has a fair amount of overcomplicated-ness. For example, I can never remember integer promotion rules, or other implicit conversions [0]. It's like a Rube Goldberg machine of rules. I often end up looking it up. I would rather it were more like Rust, where explicit casts are always required, even if it's seen as annoying sometimes. I'll give a really basic example. For example, it's not that obvious what should happen in this situation. Someone unfamiliar with C type conversion rules could assume that c is zero-extended to the size of an unsigned int and stored in u. What actually happens is that c is promoted to int, thereby sign-extending it, and then that result is cast to unsigned int. signed char c = -1; // u == UINT_MAX, assuming two's complement signed integers unsigned int u = c; If you want the zero-extension behavior, you need to cast c to unsigned char, first. If you cast it to unsigned int, c will still be implicitly promoted to int (sign-extending it first) and then it casts the result of that to unsigned int. signed char c = -1; // u == 0xFF, if c is 8 bits unsigned int u = (unsigned char)c; // u1 == UINT_MAX unsigned int u1 = (unsigned int)c Anyway, I just think C could be simpler. It could have a simpler syntax, and simpler semantics, without changing the basic model of everything being functions, pointers, primitive types, and structures. [0]: https://en.cppreference.com/w/c/language/conversion https://en.cppreference.com/w/c/language/conversion
- simonblack 3y agoThe Devil is my Lord. (I'll C myself out.)