| ▲ | clifflocked 3 hours ago | |
> Considering that it's been 54 years, and we've yet to find any human being, any at all[1], who can write C without UB Undefined behavior does not mean that a language is useless. C is quite nice to write as an abstraction over assembly, and I highly recommend writing C code and thinking about (and checking) what assembly it compiles into. Also, it is possible to verify that the types of UB that you are referring to do not occur: see the seL4 project, which provides machine-checked proofs for an OS kernel that no execution can reach a state that is undefined by the language specification. | ||
| ▲ | thomashabets2 3 hours ago | parent [-] | |
> Undefined behavior does not mean that a language is useless. Never said it was useless. But it's pretty damning that literally nobody can write correct code in the language. And my point is that it's been enough time that it can't be seen as a skill issue. > C is quite nice to write as an abstraction over assembly, and I highly recommend writing C code and thinking about (and checking) what assembly it compiles into. Absolutely. I think in order to understand programming you need to be able to write C, and be able to read assembly. C isn't "high level assembly", with the whole discussion about the spec talking about the abstract machine, but one does not need to be a C language lawyer to be a good programmer. But to your point about checking the output: That goes for Rust too, and godbolt.org supports Rust too, for this workflow. So I'm not saying C is useless. But I am saying that if someone were to decide to write their greenfield project in C, then if it plans to have actual users (as opposed to a fun project), then it's basically misconduct. Cf. Steve Gibson writes his software in assembly, still. Because he enjoys it, and his enjoyment is the primary user. I respect that. But I would NEVER hire someone to write whole applications like that in assembly. Or C. | ||