5 ms·
> Cue the Rust Evangelism Strike Force chiming in to say that there is really no reason to be writing new C code in 2019. Even as a member of the Force (RIIR 1
by thenewwazoo 7y ago
> Cue the Rust Evangelism Strike Force chiming in to say that there is really no reason to be writing new C code in 2019.
Even as a member of the Force (RIIR 1st brigade), I laughed pretty heartily at this. :)
- _bxg1 7y agoSame. But also, I feel like most of The Force's efforts are directed at C++. I could be wrong.
- jasonhansel 7y agoC++ programmers need to be converted. C programmers just need sympathy.
- deleted 7y ago[deleted]
- nineteen999 7y agoWe don't really need sympathy, we get paid a lot and can afford to drown our sorrows.
- jasonhansel 7y agoAt least until the next zero-day caused by a buffer overrun. (Kidding, kidding.)
- nineteen999 7y agoI know you're kidding, but C programmers also get paid to provide security fixes. There's plenty of C code out there that doesn't interface with untrusted data/input, or does it in a safe way. So I'm not really in fear of losing my job over a simple buffer overflow.
- Gibbon1 7y agoMost C programmers I know are generally happy. C++ programmers seem 'stressed'
- garmaine 7y agoRust programmers need Haskell.
- d33 7y agoJudging by posts here on HN, we'll eventually get there ;)
- loeg 7y agoRust is a big language, like C++. It feels too complicated compared to C.
- arcticbull 7y agoIt's not about size, it's about predictability and explicitness. Rust has features, though it also won't do anything you don't tell it to do, and its guarantees hold throughout. You don't have to know and understand how something works to be effective, just the languages guarantees. All the abstractions have zero cost anyways. If you want to write "like C but with guarantees" that's totally fine, and you can safely and predictably interface with anyone elses libraries. tl;dr: while big, it reduces your cognitive load through strong guarantees. Think of it more as progressive disclosure of complexity.
- _bxg1 7y agoI've only written a little of each, but my impression is that C has mostly remained a focused, effective language for careful systems programming. While C++ has become a sprawling cthulhu of leaky abstractions and other nasty foot-guns and people only use it because "it's as fast as C but sorta feels like a higher-level language". And that therefore Rust is a strict improvement over C++, but not necessarily C.
- rocqua 7y agoHonestly I tend to use c++ as C with easy strings for user feedback.
- hedora 7y agoI thought this way too until I worked with competent C++ devs on a modern code base. (By my definition of “competent,” no one ever encountered by the Rust brigade bloggers is competent, fwiw). At some point, I realized that C++ is a language for implementing new languages in a way that is backward compatible with existing programs. Templates are Turing complete (lazily evaluated, purely functional, and side-effect free), so whatever your language of choice can do can be backported to C++ (granted, painfully, but probably less painfully than throwing out all your legacy code and starting from scratch). On top of this, C++ supports zero-cost abstraction, so it will get very close to low level C performance (including constant propagation, loop unrolling, type-unsafe transformations, hoisting, inlining, etc, etc) even if you throw piles of lambdas and encapsulated methods at it. The costs, of course, are that the compiler is slooooowww, and you inherit all the memory safety warts of C by default. (Emphasis on “by default”, because memory safe subsets of C++ are perfectly workable.)
- MiroF 7y agoThat makes no sense - C++ eliminates many of the memsafety concerns that are problematic in C
- saagarjha 7y agoIt also occasionally obfuscates some of the safety issues under the guise of "smart" classes.