Hacker News new | ask | show | jobs
by robbrit 2474 days ago
Not 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.
2 comments

As 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.
I 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
Yes, 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.

I write C every day at a major silicon valley networking company. So it's not at all considered bad.
It 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.