5 ms·
I have been coding some time in C (and some of that doing kernel drivers), and I don't think I've ever found "unhelpfully unpredictable" behavior in regular cod
by gjulianm 5y ago
I have been coding some time in C (and some of that doing kernel drivers), and I don't think I've ever found "unhelpfully unpredictable" behavior in regular code. The "coding standard" that gets rid of those is "if it looks weird, it goes away". I've seen quite a lot of talk about the problems of undefined behavior but I haven't actually faced those problems in the wild.
- pjmlp 5y agoI suggest doing code review of offshored code delivered by sweep shop consultancies, you will find plenty of it.
- sigstoat 5y agohot tip: those folks don't produce good code in any language, don't blame it on C.
- pjmlp 5y agoRight, https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=memory+corruption https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=memory+corr...
- sigstoat 5y agoif you wanted to say "C makes it possible/easy/likely to have memory errors", i wouldn't have said anything. you drug in "offshored code delivered by sweep shop consultancies", got a response, and then move the goalposts. go away.
- pjmlp 5y agoI am not going anywhere. You were the one asserting that it only happens in sweetshops, hence my remark wasn't valid, thus I decided to broaden the scope of people failing to write C. Those mythical C developers that are yet to be found after 50 years searching for them.
- dzaima 5y agoUsing C is a tradeoff. I personally wouldn't write unsandboxed mission-critical code that has to interpret untrusted remote user input in C. But for anything that's not that, the freedom it gives over everything is awesome, and it makes many things possible to do trivially that would be nigh impossible in most other languages (at least not while keeping around any of their properties of safety). But, it is, in fact, possible for good developers to write incorrect C code. Noone's claiming that's not the case. It's just a lot less likely for someone who actually knows the language and the codebase.
- incompleteCode 5y agoThat only tells me that sweep shop consultancies are bad at writing good C code.