Comment by Panzerschrek
3 days ago
If debugging is 2 times harder than writing code we have at least two choices. One suggests to write simpler code. But another one means not debugging code at all, which may be achieved by using a programming language way better than C, which allows fixing (almost) all bugs in compilation time.
There is no programming language better than C ;-) Just people not yet experienced enough to have learned this. (Just trolling you back)
50 years of widespread C usage has shown that just trying writing without errors using C doesn't work. But surprisingly some people still believe it's possible.
> 50 years of widespread C usage has shown that just trying writing without errors using C doesn't work.
Millions upon millions of C code, over decades, controlled (and still control) things around you that would kill you, or similar catastrophic failure. Cars, microwaves, industrial machinery, munitions, aircraft systems ... with so few errors attributable to C that I can only think of one prominent example.
So sure, you can get bugs written in C. In practice, the development process is more important to fault-reduction than the language chosen. And yes, I speak from a place of experience, having spent considerable parts of my career in embedded systems.
Writing without errors using other languages also doesn't work. And if you go towards formal verification (which also does not completely avoid errors), C has good tools.
2 replies →
It's honestly strange to me that people still believe that things like type systems and effect systems and borrow checkers can actually do that. At least, without spoiling the features that make compile-time detection preferable in the first place.