Hello,
I'm completely new to C programming and I was wondering how much easier is to learn C over C++. I want to learn these languages as a hobby and I don't plan to use them for anything too complicated.
Any help will be greatly appreciated.
Hello,
I'm completely new to C programming and I was wondering how much easier is to learn C over C++. I want to learn these languages as a hobby and I don't plan to use them for anything too complicated.
Any help will be greatly appreciated.
C is simpler than C++; but, that does not mean easier than C++.
I would work on learning C++ because it is easier to do several things in C++.
And, learning C after C++ is not that hard; but, learning C++ after C is hard for some people.
Note: To learn all of C is easier than learning all of C++; this is because their is many more C++ areas to learn.
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
Well, what about the basics? Is it easier to understand the basics of C or is it easier to understand the basics of C++? The usual stuff - variables, loops etc.
C++ provides direct support for programing concepts that C doesn't. C restricts you to subroutine calls, loops, if statements, indirection (pointers), arrays, and aggregate structures. That's about it. C++ allows complicated scoping, object definition and inheritance, templates, construction and destruction, move semantics, exceptions, and lambda functions. C++ also allows for some very complicated programming via the template system that even many C++ users won't understand.
So C is far simpler. However, one of the main reasons for C++'s complexity is to make it easier to write programs without bugs. For instance, C++ has destructors, C doesn't. But C programs still need a concept of "destroying things". It's just that this is done manually. So it's much easier to have a bug that involves destroying things wrongly in a C program than in a C++ program, where the destructor is invoked automatically. So there's a kind of paradox there - complexity in the language can make for simplicity in the program logic.
I'd recommend learning C before moving to C++, however.
I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
Visit my website for lots of associated C programming resources.
https://github.com/MalcolmMcLean
I would strongly urge you to learn C thoroughly first. Then if you want to learn C++, you would be better prepared to learn and concentrate on the concepts of C++.
Starting with C++, would not give you as thorough an understanding of the C concepts common to both languages.
Others may disagree with me, however I have taught both C & C++ at a University level.