3 ms·
The article misses a really big item. I’ve programmed in C for 20+ years and then recently switched to rust. When fellow C programmers ask me how Rust is going
by xorvoid 4y ago
The article misses a really big item.
I’ve programmed in C for 20+ years and then recently switched to rust. When fellow C programmers ask me how Rust is going, I say “it’s modern” and “it’s consistent”. What I mean by that unlike C, Rust doesn’t have 50 years of baggage: string functions that handle null termination all differently, complicated implicit promotion rules, null-terminated strings that haven’t been a good idea for decades, apis that we’re completely busted by posix threads but still exist, functions that cannot be used safely that still exist, code snippet examples with horribly broken unsafe code that beginners copy-paste, dubious and bad type-based aliasing, rampant use of UB, etc etc etc
Sadly Rust is not a better C. Maybe it’ll grow into one some day. Today it’s a better C++. Sadly I’d still chose C to do C’s job.
All I want from “better C” is to fix the obviously bad problems from C’s history. Or rather, maybe that’s the committee’s job.
At any rate: it’s embarrassing that we’re still so dependent on a language that’s so broken. And it’s sad that there doesn’t seem to be a path forward.
- mtlmtlmtlmtl 4y agoWhen I discovered strsep was a thing I was genuinely a bit mad that I'd been "tricked" into using strtok all this time. Since then I never just look up a function in the standard library reference. It's a fair chance its API is far from ideal, especially in string.h
- kaba0 4y agoWhat is C’s job, when would you use it for a green field project? Not trying to start a flame war, genuinely curious as I see less and less need for C, other than maintaining all those existing code bases.
- cartoonfoxes 4y agoWhen working with the huge amounts of embedded silicon that is supported by C libraries and toolchains only.