How much C before start to learn C++ ?
09-14-2009, 10:27 PM
|
How much C before start to learn C++ ?
|
Posts: 492
Name: Lashtal
|
How much should one know about C before starting to learn C++ ?
How, and at what point, does one know when to make the next step?
|
|
|
|
09-14-2009, 10:54 PM
|
Re: How much C before start to learn C++ ?
|
Posts: 3,155
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
I'm not an expert at either language, but my understanding is that C++ is only based on C, no longer directly descended from it. This means you can skip C altogether and just study C++.
|
|
|
|
09-15-2009, 12:54 AM
|
Re: How much C before start to learn C++ ?
|
Posts: 1,068
Name: Matt
Location: Irvine, CA
|
wayfarer is correct. There is no need to learn C before C++ at all. C++ for the most part builds on C, because of the additional features and functionality there are a lot of things you would do differently in C++ as opposed to C. If your goal is to program in C++ there is no point in learning any C.
|
|
|
|
09-16-2009, 07:49 AM
|
Re: How much C before start to learn C++ ?
|
Posts: 492
Name: Lashtal
|
I ask because there's a vocational school for game design I was looking at, and in their curriculum, they start teaching you about C before going into C++
I wondered to myself, "why is that so?"
and from what I read, and correct me if i'm wrong: C++ is more object-oriented than C, but C has been explained as being easier to learn than C++
So they start off with C to warm you up with aspects of programming w/C++
|
|
|
|
09-16-2009, 08:03 AM
|
Re: How much C before start to learn C++ ?
|
Posts: 22,241
Location: Blackpool. UK
|
It's probably to teach you the language semantics, syntax, structures and types etc, which are of course the same.
It does give you a good grounding in the basics of structuring a program rather than relying on IDEs to write code for you.
It's akin to knowing HTML/CSS to be able to use WYSIWYG tools to the best advantage. Not totally essential BUT it gives you a better understanding of the whole thing.
|
|
|
|
09-16-2009, 11:11 AM
|
Re: How much C before start to learn C++ ?
|
Posts: 3,155
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Quote:
Originally Posted by Lashtal
and from what I read, and correct me if i'm wrong: C++ is more object-oriented than C, but C has been explained as being easier to learn than C++
|
C isn't object oriented at all, being a purely procedural language. C++ started out as an extension to C, with object oriented capabilities, but has far outgrown merely being an extension to another language.
C is still used for programming, for scientific instruments and in robotics, but it isn't used for desktop computing much anymore, though I think it is used to create extensions for other languages (such as Python). Because it is a fairly low level language, it is extremely efficient, which is why it is used for instrumentation.
C++ is a full-featured OOP language, that also has low-level capabilities. It is used for gaming because it has tons of libraries and toolsets built for it, and compiles, so it is very fast.
Is it wrong to learn C first? No, but it's not necessary.
Like I said before, I'm hardly an expert at either,this is just based on my understanding, and general philosophy. I've read a couple interesting articles lately about programming in general that I find very useful:
Teach Yourself Programming in Ten Years
A Career in Computing
An interesting statistic I follow sometimes is called the TIOBE Index:
TIOBE Programming Community Index. It shows how widespread various languages are, and how their usage is expanding or declining.
|
|
|
|
09-19-2009, 02:04 AM
|
Re: How much C before start to learn C++ ?
|
Posts: 492
Name: Lashtal
|
good articles, and Thank you for the info 
|
|
|
|
10-05-2009, 01:30 PM
|
Re: How much C before start to learn C++ ?
|
Posts: 10
Name: Francis
|
Yes, there is no need to learn C first to learn C++. Both are different language and having different concept.
C could work as low level language since C++ is a pure object oriented language.
Quote:
Originally Posted by wayfarer07
C isn't object oriented at all, being a purely procedural language. C++ started out as an extension to C, with object oriented capabilities, but has far outgrown merely being an extension to another language.
C is still used for programming, for scientific instruments and in robotics, but it isn't used for desktop computing much anymore, though I think it is used to create extensions for other languages (such as Python). Because it is a fairly low level language, it is extremely efficient, which is why it is used for instrumentation.
C++ is a full-featured OOP language, that also has low-level capabilities. It is used for gaming because it has tons of libraries and toolsets built for it, and compiles, so it is very fast.
Is it wrong to learn C first? No, but it's not necessary.
Like I said before, I'm hardly an expert at either,this is just based on my understanding, and general philosophy. I've read a couple interesting articles lately about programming in general that I find very useful:
Teach Yourself Programming in Ten Years
A Career in Computing
An interesting statistic I follow sometimes is called the TIOBE Index:
TIOBE Programming Community Index. It shows how widespread various languages are, and how their usage is expanding or declining.
|
|
|
|
|
10-13-2009, 12:20 PM
|
Re: How much C before start to learn C++ ?
|
Posts: 1,388
Name: Paul Davis
Location: San Francisco
|
Quote:
Originally Posted by Ciewinski
Yes, there is no need to learn C first to learn C++. Both are different language and having different concept.
C could work as low level language since C++ is a pure object oriented language.
|
I disagree with the claim of no need to learn C.
C is basically one step up from assembly. When you learn C, you will learn to understand a great deal about how your computer works. While learning C, you should try to learn some basic assembly, understand what registers in the CPU are, know some OP codes. You should also disassemble your compiled C to see exactly what the compiler is doing.
By getting a solid understanding of the fundamentals, you will write better programs for the rest of your life, regardless of language.
C++ is backward compatible with C. Basically, any C program is also a valid C++ program. However, C++ is meant to be used as an object oriented language. With this, there are new concepts to learn, new ways of designing and building programs, a new way of thinking about solutions.
When you start to learn C++, you'll want to set aside much of what you learned when writing C. Getting a grip on objected oriented programming can take some time. It's a little thing we can the surfeit of zen. It's hard to understand a piece without understanding the whole. Keep at it and you will have your aha! moment.
|
|
|
|
10-14-2009, 04:36 PM
|
Re: How much C before start to learn C++ ?
|
Posts: 3,155
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Quote:
Originally Posted by willcode4beer
I disagree with the claim of no need to learn C.
|
I think the idea I've been getting at is that it isn't wrong to learn C, but not necessary that you must learn it before learning C++. I study C++ on its own, and learn a lot of C along the way.
I don't see C++ as a purely OOP language, but rather a language that is capable of being used in either in an OOP or a procedural fashion.
C is certainly a useful language in and by itself. The entire Linux codebase, for example, is written entirely in C and Assembly. It's just that C isn't very useful for most developers, especially web-developer types, who will probably never need it for real applications. C++ isn't used that often for web development either, but since it is a higher level language, it does have a couple of web frameworks I've read about.
There's no debating that having a language that compiles is very useful, even though the cost of buying more memory and equipment is so cheap in comparison to the cost of manpower.
|
|
|
|
10-20-2009, 01:11 PM
|
Re: How much C before start to learn C++ ?
|
Posts: 1,388
Name: Paul Davis
Location: San Francisco
|
Quote:
Originally Posted by wayfarer07
There's no debating that having a language that compiles is very useful, even though the cost of buying more memory and equipment is so cheap in comparison to the cost of manpower.
|
...to a certain point. Because, it takes manpower to keep the machines going.
For example, when I took my current job, they had an application up that required 70 servers (16gb ram each) to run. The result was, it took a lot of attention from the system admins (mostly because the boxes also needed frequent restarts).
I invested some " manpower" and heavily refactored the application. It now runs on 6 servers (4gb/ea), they never need restarts. So, the investment of some manpower can save a lot more over the long run.
Granted, that's an extreme example.
My main point above is, when you learn C, you learn to understand the machine. Even if you only ever program in Ruby/Python/whatever later, you'll do better if you understand what's going on underneath.
|
|
|
|
10-24-2009, 08:22 PM
|
Re: How much C before start to learn C++ ?
|
Posts: 492
Name: Lashtal
|
Quote:
Originally Posted by willcode4beer
My main point above is, when you learn C, you learn to understand the machine.
|
Would you say that you can learn just as much about the machine studying C++, or is it more desirable for one to learn C for this reason?
|
|
|
|
10-24-2009, 09:35 PM
|
Re: How much C before start to learn C++ ?
|
Posts: 1,068
Name: Matt
Location: Irvine, CA
|
While C does tend to work at a lower level than C++ it is not nearly as low level as assembly code. If you really want to learn how the machine works at a lower level, skip C, learn C++ (I think you'll find this requires less "unlearning" of C style coding) and learn assembly code. C++ actually supports the integration of assembly code into a program, here is an implementation of the factorial function I wrote using assembly(x86) in C++:
Code:
__declspec(naked) unsigned int
factorial(unsigned int n)
{
__asm{
mov ebx, [esp+4]; // n
cmp ebx, 1;
jle END;
mul ebx;
dec ebx;
push ebx;
call factorial;
pop ebx;
END:
ret
}
}
Last edited by NullPointer; 10-24-2009 at 09:37 PM..
|
|
|
|
10-28-2009, 11:34 PM
|
Re: How much C before start to learn C++ ?
|
Posts: 492
Name: Lashtal
|
Quote:
Originally Posted by NullPointer
C++ actually supports the integration of assembly code into a program...
|
interesting to know.
|
|
|
|
10-29-2009, 08:26 AM
|
Re: How much C before start to learn C++ ?
|
Posts: 3,155
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Straight C also supports the integration of assembly code. The real question I'm interested in however, is how do I connect to a MySQL database using straight assembly?
Ok, it's 7am here, my sense of humor is a bit stilted...
|
|
|
|
10-29-2009, 08:40 AM
|
Re: How much C before start to learn C++ ?
|
Posts: 22,241
Location: Blackpool. UK
|
Quote:
|
how do I connect to a MySQL database using straight assembly?
|
Now it's funny you should ask that  ...
|
|
|
|
10-29-2009, 08:41 AM
|
Re: How much C before start to learn C++ ?
|
Posts: 22,241
Location: Blackpool. UK
|
...
No, sorry even I'm not that nerdy 
|
|
|
|
|
« Reply to How much C before start to learn C++ ?
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|