4 ms·
I didn't say that C++ should not be used, and that everyone who uses C++ should switch to C for anything that they would like to program. There's a place for C,
by pelmo 6y ago
I didn't say that C++ should not be used, and that everyone who uses C++ should switch to C for anything that they would like to program. There's a place for C, and there's a place for Lisp, and there's surely a place for C++.
Culturally, we're at the place where most of people prefer higher-level things that are "easier". The growing complexity of the C++ makes some people who prefer to work on higher-level languages anxious to consider the lower-level languages like C++.
What I was trying to convey is that C is a good start for fundamental concepts of programming and everything you need to start programming in C++ - if you want to specifically use that for your tasks. However, people are different, goals are different, we don't know what are these projects. If you're using C++ to build small programs and you don't care about efficiency - I can only shrug and say "well, you do you".
Again, I did not say "don't use any of C++ cool features". It would be even easier to grasp the complexity of C++ once you understand what's the root of the problem, why people even come up with these features, and why do you want to use them.
In your reply you just jump to conclusions, saying that "no RAII is bad" to someone who probably may never need it.
- gumby 6y agoThe part that was most problematic is highlighted below. > Maybe, if you invest enough time and dedication, you'll realize that all these fancy features that C++ implements are unnecessary. It's true, you can write anything you could write in C++ in a universal Turing machine. I don't write a lot of assembly any more and haven't written microcode in decades but sure, I could write a web server in assembly code. unwind-protect is thankfully pretty fundamental to avoid typical resource problems; its more than syntactic sugar. When I started writing C code around 1982 it was the thing I missed the most. Counted strings not only avoid a huge number of security problems and bugs, but have been known to be significantly faster than delimited strings since around the same time. But sure, if you don't care for them don't use C++.
- pjmlp 6y agoMaybe I am missing something, but when we care about unwind-protect, I would rather stay with safer languages than C++.
- pelmo 6y agoI'm sorry, I don't understand what you're arguing about. I was replying to a person whose use case for C++ nor me, neither you, understand. It could be simple small programs, not hundreds of thousands of lines of code that needs to be managed by modern programmers who write everything in OOP style. Different people structure their code differently, and programming is like solving a puzzle. You can have a mindset that makes you choose the modern features. We both have different backgrounds and perspectives. Would you go about using a "garbage collected" language without learning why it has garbage collection in the first place? You would, if your goal is to simply make things work as quick as possible, and just trust the tool that you're using. I do not have that trust when I work on my projects. When I suggest something that is related to programming, I do it from the perspective of quality (e.g. performance and clarity), and understanding of how things work, and from there you're free to do, choose, pick whatever you want. >But sure, if you don't care for them don't use C++ We're not helping the person who asked "how to go about learning C++ without being worried about its unnecessary complexity" with these arguments. The point is that you can use C++ without its "Modern" features. And you should, if you care about the quality of your code (clarity and performance). When I'm talking about "Modern" features, I do not mean things like inferred typing or function overloading or templating. But various std:: function/container implementations.