Hacker News new | ask | show | jobs
by somerando7 1497 days ago
The lengths people will go to not use C++ is staggering.
4 comments

> 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.

Yeah, having to define all vector functions as macros is definitely the epitome of readability and maintainability.
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++.
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++.

Yes, writing libraries and tools. The horror.
I see nothing wrong in having a preference if both C and C++ can be used for the same project and if the development speed is roughly the same.
Why are people driving Nissan Leaf to work when they could be driving Veyron Bugatti? Its clearly more powerful and way faster.