3 ms·
I'd rather lose an hour to dealing with the borrow checker and type safe design than spend weeks debugging an intermittent segfault.
by nivenkos 4y ago
I'd rather lose an hour to dealing with the borrow checker and type safe design than spend weeks debugging an intermittent segfault.
- jstimpfle 4y agoMe too (of course), but the last time I had a segfault that took me longer to fix than at most a couple minutes must have been years ago. The last time I got a segfault at all is probably months ago. It's a matter of the more global design - factoring out the nitty-gritty things in some central places removes many bugs without you having to think about it. A lot of "usage" code then looks very simple, almost python-like. Variables and function calls. A few ifs and elses, a little bit of arithmetic. Look at the Linux kernel for example. It is superficially not pretty, but you have to walk around quite a bit for example to see explicit locks and unlocks. It's a matter of factoring out the hard stuff in central places. This is a skill that is totally unrelated to the language you're using. Yes, bugs happen to everyone, and more so in C than some other languages. Yes, there are security problems that come from lack of memory safety. But simply in terms of productivity, I feel that C is a very good tradeoff for me.
- tomcam 4y agoI always, always programmed defensively and this happened to me very seldom during my decades as a C programmer.