by bsder · 5y ago · 0 comments
I used to think that using C++ was acceptable in some cases. I no longer do.
The faults isn't even C++ the language, per se. It's the ecosystem--or more appropriately--the lack thereof.
A lot of the modern languages integrate with C, properly. They integrate on Linux, Windows, OS X/macOS, iOS, Android, etc.
Nothing integrates with C++ well, and it's the fault on the C++ side. That means dumping C++. Perhaps the C++ compiler writers will finally have some incentive to fix their crap.
Or just integrate with C++ code by exposing it through C linkage with `extern "C" {}`. Sure, C is the de facto lingua franca of programming languages, but that doesn't seem like a pragmatic reason to choose C over a different language that may be better for the job. Also, C++ has a massive ecosystem.
Nope. Been there. Done that. Got the scars.
For example, what happens when an exception gets thrown on the other side of that "extern C"? Yeah, undefined.
The problem is that if you're using C++, you get the C++ machinery--allocators, exceptions, etc.--and you can't dodge it.
Not even wrong !