6 ms·
I am hoping this isn’t an implication that C is legacy and C++ is the modern and the future. :-)
by siggen 7y ago
I am hoping this isn’t an implication that C is legacy and C++ is the modern and the future. :-)
- robbrit 7y agoNot that I've worked in a lot of places, but everywhere that I've worked that uses C at all treats it this way. Writing new C code is considered a no-no.
- EliRivers 7y agoAs a view into a different part of the industry, when I was writing code for cheap embedded processors, it was C code all the way.
- colonwqbang 7y agoI write code for expensive embedded processors and it's still C all the way, with C++ recently starting to make a (small) appearance. As such I'm acutely aware of the wonderful incompatibilities between C and C++. My favourite is this: struct point { int x; int y; }; int main() { struct point p = { .y = 0, .x = 0 }; } error: designator order for field ‘point::x’ does not match declaration order
- ncmncm 7y agoYes, embedded development has always been stuck in the stone age. C is actually a recent, and major advance over assembly. It happened only because vendors discovered they could steal accounts from competitors by being source-compatible, even though their ISA was different. C++ does not offer that advantage for them, no matter how much it might benefit developers, so they have no intention of ever supporting it. But Arduinos are programmed in a dialect of C++, so it will become necessary to enable it in the near future, i.e. by 2030. Civilization might fall first.
- deleted 7y ago[deleted]
- mlindner 7y agoI write C every day at a major silicon valley networking company. So it's not at all considered bad.
- ncmncm 7y agoIt is considered bad at many other places. I would add, more enlightened places. But competent C++ programmers are expensive. It is harder to tell whether a C programmer is competent, because the code they write has less room to be better than minimally tolerable.
- deleted 7y ago[deleted]
- Gibbon1 7y agoC is a niche language and C++ is about to hit the wall as companies abandon it for languages like Go and Rust.
- bt848 7y agoYou're high. In industry C and C++ are very widespread. Go and Rust are ... not. You'll have an easier time finding a job that requires FORTRAN than one requiring Rust, and Go is only a bit more popular.
- Koshkin 7y agoWell, you go to C++ for the climate; you go to Go or Rust for... the company!
- Gibbon1 7y agoLets touch base again in five years and see how C++ is doing.
- ncmncm 7y agoLet's touch base in five years and see if anybody remembers Rust. It is likely they will, but not assured. Consider that the number of programmers adopting C++ every day far, far exceeds the number adopting Rust, and the rate is increasing faster, in absolute numbers, than ever before, it is hard to imagine any scenario where C++ is less popular, relative to Rust, than today. Yes, C++ usage will less than double, while Rust usage will multiply, but the absolute difference in number will be much larger than today.
- icedchai 7y agoYou seem to underestimate the vast amounts of existing C++ and C code. That code is not going anywhere, especially in only 5 years. Companies are not going to rewrite stuff in Rust just because of memory and type safety. Touch base in 5 years... Rust will still be a niche language due to its complexity. (IMO, Go has a better chance of at least picking up a few percentage points.)
- bitwize 7y agoC isn't just legacy, it's fundamentally broken. Rust is the future. C++, while it mitigates some of the brokenness of C, favored backward compatibility with C over fixing the brokenness once and for all.