News for hackers. Stuff that matters.
Re:The problem with C by jstimpfle on Thursday September 03, 2020 @05:57AM (#24362435)
Yup, designated initializers is a big one why I prefer C to C++.

Another big one is implicit casting of void ptrs. I cast void pointers to specific types A LOT. There are many situations where you have to cast void pointers (that come from an abstract API that only deals with untyped memory) to specific types (higher-level application code), and I can't really be sure, but I think there isn't a nice way to do that in C++.

It might be because C++ wants you to use their elaborate abstractions and templates, which in many situations is just fluff that makes programs harder to read and maintain.

Re:The problem with C by hellofunk on Thursday September 03, 2020 @06:26AM (#24362596)
You can cast void pointers in C++ as well, and it is very easy. The difference is that usually you would use a specific kind of cast that makes this clear to the reader.
Re:The problem with C by secondcoming on Thursday September 03, 2020 @06:49AM (#24362695)
reinterpret_cast was the canonical way of doing it in C++, but now I believe that this is actually UB and so modern C++ should use std::bless.

C++ also supports C-style casts but it's a code smell.