News for hackers. Stuff that matters.
Re:Common libraries and data structures for C by lelanthran on Tuesday May 17, 2022 @03:02AM (#31406929)
> The lengths people will go to not use C++ is staggering.

Every C thread on every forum always has some C++ proponent jumping in to bemoan that people prefer one of the simplest languages over, literally, the most complex (from a programmer PoV) language in existence.

Is it really such a stretch to believe that people prefer readability and maintainability over expressive power?

The "lengths" in this case is small - a once of cost of a few days to implement vector and string functions gets you most of what most developers need and want.

Re:Common libraries and data structures for C by ImprobableTruth on Tuesday May 17, 2022 @07:43AM (#31409018)
Yeah, having to define all vector functions as macros is definitely the epitome of readability and maintainability.
Re:Common libraries and data structures for C by wruza on Tuesday May 17, 2022 @07:58AM (#31409161)
In this specific case I think we have to agree with your point. When code have to go all-.h, it’s already reasonable to go [a subset of] C++.
Re:Common libraries and data structures for C by somerando7 on Tuesday May 17, 2022 @09:30PM (#31418295)
Every single time there are some people who love C (in my experience for the reason they haven't worked professionally in C++) that claim that they're actually WAY more productive and readable when working in C.

C++ is basically almost a perfect super-set of C. Use the parts of C++ that are useful to you, don't use the parts that aren't. Clearly std::vector, std::string, std::unordered_map would be ultra useful to anyone. Especially because they are easier to use, more optimized, not as prone to errors as their C equivalents.

I blame Jonathan Blow and Muratori for this. They somehow got the entire gamedev community to worship the idea of writing things in C. People grow out of it really fast though, as soon as they actually learn C++.