News for hackers. Stuff that matters.
Re:Switching to C over 'Modern' Programming Languages by xedrac on Friday April 14, 2023 @02:40AM (#35566254)
C++ is a monstrosity, but RAII is greatly missed when using C. I'm much more inclined to use Rust these days.
Re:Switching to C over 'Modern' Programming Languages by maccard on Friday April 14, 2023 @06:52AM (#35567943)
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.
Re:Switching to C over 'Modern' Programming Languages by xedrac on Friday April 14, 2023 @11:03AM (#35570325)
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.