View Single Post
Old 12-27-2022, 07:06 AM   #204
jbjb
Somewhat clueless
jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.jbjb ought to be getting tired of karma fortunes by now.
 
Posts: 790
Karma: 11000001
Join Date: Nov 2008
Location: UK
Device: Kindle Oasis
Quote:
Originally Posted by Quoth View Post
The problem is that people should have stopped using C for new projects, because it's so obsolete and terrible.
I wouldn't characterise as obsolete a language that is still in very wide use, and which is still in constant development (the latest published specification of C dates from 2017, and there's a new one expected in 2023).

'Terrible' is a matter of opinion. Clearly you think so, but many would disagree.

Quote:
C++ was better than C in 1987 and now much better. It would have been better still if AT&T hadn't insisted on C compatibility.
I'd certainly agree that C++ is much better than C for most purposes, but for severely constrained systems (e.g. embedded systems running on microcontrollers with very little memory) C still has its place. While you can program these systems in C++, there are several features of that language which can lead to code bloat and other inefficiencies if used inappropriately (e.g. templates, exceptions) and dangers hidden in standard libraries (e.g. issues with std::string, or other STL containers, and thread safety).

In practice, you often end up being restricted to a subset of C++ to avoid those traps, and that subset starts to look very much like C. In those cases it's often cleaner just to start with C, and take advantage of its explicitness - what you write is what you get.

Clearly, C can be misused (so can every language), but well-crafted C, written by competent programmers, is still a perfectly sensible approach for many problems. When I'm writing a large application, I won't choose C, but if I'm e.g. hand-crafting a threading system for an embedded microcontroller I might well use C.
jbjb is offline   Reply With Quote