C++ != OOP, while C++ cannot fix flaws inherited from C, at least it can provide types with bounds checking, and data types with type driven invariants, something that C will never provide.
I need to think on this one - I don't think they're suitable for embedded beyond the scope of learning. Eg a non-starter for anything battery powered, or with minimal latency requirements, which are both common in embedded. More subjectively, they strike me as something designed for people who approach problems with a mindset of "I'm a Python programmer - how do I do this without learning a new language?".
I'm writing Python code now to prototype DSP algorithms and generate coefficients for embedded, but I wouldn't run Python on the MCU.
No, we can’t. Because C is a necessary evil. If you stop teaching people to program in C, who is going to maintain virtually every software this world is running on?
Presumably the same way find all of the people who maintain all of the critical software written in Fortran or COBOL or Ada or other languages that aren't really taught in schools anymore.
If a new hire is minimally competent at programming, I can bring them up to speed in whatever language it is we are using. Hell, even when people have notionally been taught a language in school, there's a decent chance I would still have to train them in that language as a new hire, because what they learned in school may be insufficient to cover the complexities that get involved in practice.
And to OP's point: C itself is a pretty poor language at covering what it actually covers. It has some missing features that just seem random (e.g., there are no 8- or 16-bit arithmetic operators in C). It has gratuitous undefined behavior (signed integer overflow and strict aliasing). As a language design, it's atrociously outdated (#include is a very poor substitute for modules, and generic programming might as well not exist in C). There are questionable features--null-terminated strings don't look like such a good idea in retrospect. Even if you want to avail yourself of its strengths--access to low-level hardware features--C's gratuitous undefined behavior (particularly strict aliasing) undercut it there, and languages like Rust and Zig give you the same power with none of C's warts.
> C itself is a pretty poor language at covering what it actually covers.
C's job is to be the first thing ported to a new architecture, allow you to bootstrap a system, and build on top of it (last 2 steps optional if you're working on some sort of embedded system).
And, frankly, it's reasonably good at that. Writing a simple C compiler is trivial compared to something like rust.
Just like the drug war is used as an excuse to empower fascists in government, strip citizens of their constitutional rights, and disrupt leftist and minority communities.
I think a simple “const” would have also done the trick. Sometimes -O3 is clever enough to figure out that the value is never written, so it makes it an asm constant.
It is mostly about the fact that if the variable is not static, then it's non-local to the translation unit and can be modified from everywhere else. So its value needs to be loaded and a plain and slow division is applied.
Having it local or const makes the compiler able to inline it and do a simple bitwise and with a constant.
So yes, make your variables static const by default (if you really need global).
I, on the other hand, appreciate Safari not being an utter resource-hog and a battery drainer. I don't need all these shiny features. I'm ok with "dumbed down" static sites.
Exactly. If the site doesn’t work in Safari, I don’t need it. If you are designing a site for my consumption, you damn well better be designing it to be usable on my devices. Especially my iOS and iPadOS devices which account for about 70% of my tech use.
There was a free concert in a park of my city recently. I wouldn’t mind hearing it, but traffic and parking was too much of a pain in the ass so I stayed away.
How odd that I would let things that irritate me get in the way of hearing a free concert.
I'm not sure I understand you correctly, but I think it would be a more apt comparison to complain about the songs performed at the free concert rather than all the externalities of it. If that's your complaint, then I stand by my observation: how odd...