3 ms·
>a lot of problems that aren’t actual language problems but rather programmer problems This is a really naive take. In aerospace design we have the concept of
by na85 5y ago
>a lot of problems that aren’t actual language problems but rather programmer problems
This is a really naive take.
In aerospace design we have the concept of "Design for Human Factors" or "Human Factors Engineering" which is basically an acceptance that the pilot or crewmember is a fallible, flawed "system".
That is to say in aerospace we recognize that human beings have limits. They have finite breadths of attention, and they panic in a crisis, and they make mistakes when fatigued, and they're not capable of performing repeated tasks 100% consistently.
That's why for example we make the "fuel cut off" switch a different size and color than the intercom switch. That's why we make the engine fire extinguisher handle very prominent and easy to grab, etc.
For how many decades have software folks been writing use-after-frees and off-by-ones?
When is Software as a field going to get over its collective hubris and admit that C is poorly designed from a Human Factors standpoint? A tool that requires unattainably- or unsustainably-high human performance is a shitty tool; get a better one.
- voidhorse 5y agoThat’s an enlightening counterpoint and I agree. I think, when common human factors are known and understood, we should design against them. I also would not recommend writing any large-scale modern software in C unless absolutely every piece of the codebase is performance critical, which is highly unlikely, and in which case you can probably use c++ for at least a few more safety features. Is C still a good choice for simple CLIs and small programs that don’t do anything drastic? I’d argue it is. I was moreso using hyperbole to try and point out that it’s easy to judge our forebears for problems that we didn’t even know were problems yet. Saying “C is a poorly designed language” usually amounts to saying “C is a poorly designed language from today’s perspective” which is a bit disingenuous considering we wouldn’t even know about these problems without C. It’s kind of hard to be omniscient and design against things you didn’t even know are problems yet. Furthermore, for all the flak it gets, I think C got a lot of things right—it’s easy to forget that programming languages copy more from C than they distance themselves from it—really the only major wins are giving programmers less control over memory, easier numeric types, easier string manipulation, and generics, and go proved that even the last enhancement isn’t really necessary. Sorry for playing the role of C apologist in this thread, but I feel a lot of these broad complaints about C are sort of immature insofar as they seem to eschew all historical context. I guess I’m just trying to point out that I see a lot more genius in C’s design than I see foolishness, but some people would have you think the C designers were complete idiots with the way they disparage the language. There’s a palpable lack of humility in such complaints.
- na85 5y ago>Saying “C is a poorly designed language” usually amounts to saying “C is a poorly designed language from today’s perspective” which is a bit disingenuous considering we wouldn’t even know about these problems without C. I mean okay, but whether or not we have historical perspective doesn't change the fact that as we now understand it, C is poorly designed. If it's poorly designed, then it's poorly designed and we should stop using it. There was a time when we "lacked historical perspective" and we built the De Havilland Comet, too. People died. Turns out that square windows cause stress concentrations so we started using better techniques. Nobody was arguing "yeah but for simple CLIs and small programs that don't do anything drastic, square windows are fine". Square windows suck so we make rounded corners now. C sucks, we should use something that sucks less.