Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Your criticism lacks constructivity. What do you propose we replace C with?


view as:

Depends 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.

Just 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?


Agree 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.

Ada 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.

FYI, "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


Whatever 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.


lol rust, get real.

Rust?

Legal | privacy