Hacker News new | ask | show | jobs
by maccard 1162 days ago
Disagree on c++. Even if you forego the significant improvements in the last decade then: RAII and templates make it worth not using C anymore. Having to use shoddy macros for a resizeable array is just unreasonable.
2 comments

I've written C++ for a long time, and I do agree that the language brings certain improvements over C. I think most people will agree with that. However, C++ can be incredibly frustrating to work with depending on the codebase.

Overall, C++ can be great choice, but it often times results in not being due to lack of rigorous discipline by everyone involved on the project.

It's a bit philosophical whether that's a problem of the tool or the craftsman, but I think it's usually a bit of both.

C++ is a monstrosity, but RAII is greatly missed when using C. I'm much more inclined to use Rust these days.
Agreed that it's a monstrosity, but the reality is that much of that monstrosity is hiding subtle background issues that exist in C that people don't talk about. look at the implementation of std::vector, and compare that against most of the home rolled macros that (dangerously) wrap calls to realloc, and tell me which one is the monstrosity! Personally, I'm glad someone else wrote vector and that I don't need to handle that.
I agree. C is absolutely terrible to use for anything that's not trivial. It may have a simple spec, but you pay dearly for it in code complexity. Its abstraction capabilities are only marginally better than writing straight assembly.