4 ms·
This C apologism is holding the industry back. Software development has changed many times over since C came out and it just isn't a good tool for tackling a lo
by adamnemecek 10y ago
This C apologism is holding the industry back. Software development has changed many times over since C came out and it just isn't a good tool for tackling a lot of the issues that we have today. Just about every software project written in C has some serious bugs.
I personally judge a language by how well it lets you to define abstractions. In C's case, it doesn't let you do that very well.
- quickben 10y agoYour criticism lacks constructivity. What do you propose we replace C with?
- adamnemecek 10y agoDepends on what you are writing. C isn't 100 percent replaceable right now but the more people bitch about it and support the alternatives, the better for the future.
- SeanDav 10y agoJust curious, what are us C apologists supposed to be apologizing for: - A lack of suitable replacement for C? - C is too ubiquitous? - C has been an integral part of most of the best software ever written?
- usefulcat 10y agoAgree with the first two but the last isn't saying much. C has been an integral part of most software ever written, best, worst, and everything in between.
- naasking 10y agoAda has been a suitable replacement for C since the early 90s when GNAT was released. Prior to that there were still plenty of suitable C replacements given a little work, like Pascal and Oberon.
- dbaupp 10y agoFYI, "apologist" is often not used to literally mean "one who apologises", but rather "one who defends"[1], with a negative connotation (at least in my experience). I would guess the "C apologism" in the original comment is referring to defenses of C that pretend C is safe "in practice" (or "for people who know what they're doing") or minimise/ignore the strong correlation between the use of C and serious problems/vulnerabilities. [1]: https://en.wiktionary.org/wiki/apologist https://en.wiktionary.org/wiki/apologist
- deleted 10y ago[deleted]
- loup-vaillant 10y agoWhatever doesn't have extremely tight constraints (CPU, memory, embedded…) should probably use garbage collection. Now your language can throw a nice exception (or otherwise cleanly abort the process) before any memory corruption (and subsequent vulnerabilities) can occur. Otherwise, I'd say try something like Rust. And if Rust doesn't make the cut, maybe go write your own C-like dialect, with less undefined behaviour.
- y_u_no_rust 10y agolol rust, get real.
- pcwalton 10y agoRust?
- targ2002 10y agoI don't think it sensible to single out C for having serious bug. It should be most software projects have serious bugs.
- buserror 10y ago"Just about every software project written has some serious bugs" There, fixed it for you. Seriously, vulnerabilities and bugs are found everywhere not just in C. I've been programming for 35 years, in so many languages I lost count, and every time I've seen the 'let's not use C because it'll lead to bugs' it was to be replaced by another thing that was ALSO leading to bugs, and/or become so bloated it was in itself... a bug.
- adamnemecek 10y agoA: "Let's not reuse syringe needles, it leads to spread of HIV". B: "I've been using syringes for 35 years and clean needles won't get rid of HIV entirely". Well no duh. But that isn't really a counter argument. > become so bloated it was in itself Whereas C is the pinnacle of expressiveness?
- benmmurphy 10y agoThe big problem with C is the memory safety issues. It is extremely difficult to write C code and be safe from malicious input. If you use a memory safe language these difficult issues are erased. I realise the compiler/runtime can't stop all bugs but fixing these simple errors goes a long way to producing robust secure software.
- ArkyBeagle 10y agoI am sorry, but there's nothing difficult about it. Tedious, yes. Difficult? No.
- adrianN 10y agoI hope you will agree that there are things where C is not the optimal choice (e.g. you wouldn't choose C for writing scripts). Many people argue that C is still suitable if you need maximal performance or do stuff that is very close to the hardware, like operating systems. Now, people who say that C shouldn't be used at all are just convinced that even in those applications there are now better choices than C. Safer languages like Rust exist that at least claim to fill the same niche as C.
- 10y ago
- ArkyBeagle 10y agoC enables - in my opinion - better abstractions than languages which constrain you to the use of their suite of abstractions. I'd include C++ in that, and especially template-heavy C++.