3 ms·
I love writing C when I haven’t written C in several years. It feels nostalgic and simple and elegant in my mind, and then I remember all of the issues I run in
by weberc2 7y ago
I love writing C when I haven’t written C in several years. It feels nostalgic and simple and elegant in my mind, and then I remember all of the issues I run into and how none of them have good, clear solutions. Things like writing cross platform code or string manipulation or how often things I swear I understand actually have bizarre edge cases, things I thought were well defined behavior are actually undefined, etc.
- jacquesm 7y agoThe one thing C will teach you quite quickly is that trying to be 'smart' gets punished, harshly.
- turk73 7y agoI don't know what you mean, exactly. I do recall that in 1991, I was the only student in my "Introduction to Programming Using C" 101 class (as a Freshman in college) who could understand pointer arithmetic. That class ended the careers of many aspiring Computer Science majors. I eagerly learned C++ a few years later. I did not understand at the time what shitpile OOP is. I was totally in OO because it was the "industry trend." Someday we'll fully recover from that entire folly.
- weberc2 7y agoI’m not talking about being clever, I’m talking about writing code that meets some baseline standard for security, correctness, and cross platform functionality. The issue with C is that standard, “unsurprising” code often behaves unexpectedly.
- takeda 7y agoI didn't get that impression when I used it, if it does that then most likey your code wasn't so standard or your understanding of the language was incorrect. I personally only got in trouble in C when trying to be too clever.
- UncleMeat 7y agoYou'd be an extreme exception, then. The truth is that decades of projects written in C have clearly demonstrated that people can't write secure programs in C.
- jacquesm 7y agoPeople can't write secure programs in any language. But C programs have ways of being insecure that other programs don't.
- weberc2 7y agoVirtually no one can write secure C code. This is different than “other languages allow some people to write insecure code occasionally”.
- jacquesm 7y agoYou're missing the point: writing secure code is categorically impossible, no matter what the language. That's very much different from 'other languages allow some people to write insecure code occasionally'. Every piece of code, every system ever built and every piece of hardware ever designed had bugs in it and if that item was supposed to be secure over time it will turn out that it wasn't. So the best you can hope for is that an item is obsoleted before you (or an adversary) detects its flaws and you're going to be fighting a rearguard action. The whole idea that many eyes or 'safe' languages or some other magic bullet are going to solve this is so far off-base that it makes productive discussion impossible because everybody starts to focus on the particular tool at hand whereas the real problem is an instance of of the class 'architecture', not of the class 'tool'.
- weberc2 7y agoI don’t think I’m the one missing the point. You seem to be rebutting points I didn’t make, like other languages (or magic bullets) afford a bug count of zero. You also seem to be ignoring my point, which is that C is in a different ballpark than other languages in its difficulty of implementing correct software.