Want to learn programming...again

Started by
32 comments, last by Ectara 11 years, 1 month ago

Sigh...please read my post properly before replying...



"Well, C and C++ are considered the same language but there are some differences beside the obvious use of OOP in C++..."


That statement is still incorrect, no matter how you emphasize it. They are nowhere near considered the same language, and there are many differences. Their standards move at different paces, and disregarding even OOP, there are a surprisingly large amount of things that C supports and allows that C++ does not, and vice versa. Not to mention, a wealth of different keywords (and meanings for them), with new types that are exclusive to C or C++. C++ started out before the first ANSI C standard; it is in many ways not a superset of the language, because it wasn't wholly built upon it. In many ways, it was influenced by the success of C as a programming language, and borrowed its syntax, but it was developed alongside it, and separately.

To keep saying that they are almost the same is just not true. There are many code samples that will compile differently (or not at all) in either language. Perhaps try to elaborate on your point so that you don't confuse newcomers? That's the reason people are calling you on it.

>Anyway, I think learning OOP straight off the bat is going to leave many beginners feeling lost. I've seen it on the courses I have taken where some have withdrawn because they jumped the gun with procedural programming. One has enough on their plate with loops, control statements, data types, opening and closing files without throwing OOP in to the mix. Yes, its an important concept, but one thing at a time, no?


I agree with this, but it might depend on the teacher. My teacher for C++ was terrible. She didn't know what she was doing, and was teaching C with Classes. Everything went in a class, even things that held no state; they should have been free functions in a namespace, but she didn't teach namespaces. We had char arrays for everything, because she didn't teach the standard templates. We got ripped off in our education. As a result, my code was absolutely horrible, and it took me many years of finally swearing off classes because I didn't need them, before I could learn how important they were.

Often, going without a feature and doing things the hard way is the best way to learn to appreciate a feature.

On the point of C++, I still don't agree with you and like wise, so we shall have to leave it there. Moving on from that, I do agree with you on the differences between C and C++. When I tried learning C++ back in the day(about 2000), there was a lot of "if you know C then you already know C++". I fell into that trap and it took some rather harsh peers to point out that mistake after so many years of bloody awful code. One piece of advice was to get a copy of Herbert Schildt's C++ Reference book, in which Schildt covers the differences. The other was learn software development and maths, but thats for another time, perhaps.

Concerning teaching of programming...yes, it can be frustrating when being led by bad advice. I remember an article in PC Format, a few years ago, when they ran a guide to XNA and C#. Some of their advice was along the lines of "People who read programming books and go on courses are idiots. Save time by just cutting'n'pasting other peoples code. If it doesn't work then you haven't lost anything!". Some poor sod most probably took that advice and after so much wasted time of poncing other people's code which only served to generate loads of IDE error reports which they had no idea what they meant, decided to go back and learn C# properly. On the other hand, I had some good tutoring with the Open University here in England. There was a course in Java, and considering quite a few students were new to programming, they actually enjoyed the introduction to OOP - even without prior knowledge. In a nutshell, they used the idea of frogs, toads & lilypads and considering I was rebellious to formal education, I was won over by how they taught OOP to complete beginners. They've got an improved presentation of that course(M250) and I do recommend it to those either trying to learn Java or even just OOP.

Languages; C, Java. Platforms: Android, Oculus Go, ZX Spectrum, Megadrive.

Website: Mega-Gen Garage

Advertisement

C++ is a super set of C... circa 1983.

That's the relationship between those two languages. Since then there have been 20 years of separate evolution between those two languages.

So no, the are not the same, not even close.

C++ is a super set of C... circa 1983.

That's the relationship between those two languages. Since then there have been 20 years of separate evolution between those two languages.

So no, the are not the same, not even close.

Serapth, myself and the above posters actually agree that C and C++ are separate languages. That is not what is the debate here. The disagreement is that they believe I have not been clear about that in how I've worded it that C and C++ are separate languages, whereas I feel I have been clear about it.

Okay, if I had wrote "C and C++ are the same language.", then I could understand the objection. But that is not what is not what I wrote - I wrote "Are considered the same language" because like Ectara's Teacher whom they mention, there are far too many people who do consider C and C++ the same language when they clearly are not. C++ is not merely C with OOP tacked on - which is rather clear with my further correction of that misconception with "but there are some differences beside the obvious use of OOP in C++...", which is in the same sentence.

Alright, on that point I hope that clears up any misunderstanding that has gone on here. I will even go one further and be kind by saying that if I've upset anyone here over this misunderstanding then I apologise, for that certainly was not my intention.

Languages; C, Java. Platforms: Android, Oculus Go, ZX Spectrum, Megadrive.

Website: Mega-Gen Garage

C++ is a super set of C... circa 1983.


Not a strict superset; this term implies that it has things that C had plus more, and that all valid C programs are valid C++ programs. Even something like:

function(){
return 0;
}

will act completely different in the two languages.

This topic is closed to new replies.

Advertisement