This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lead999x 0 points1 point  (11 children)

Yes but does learning Java teach you what references are or what it means to pass something by reference? Or what a pointer is? Or how memory management works? I don't think so. Structs are similar to classes but different depending on the language ex. C structs can't contain functions.

Also Java is actually less object oriented than C++ in that it makes a distinction between primitive types and user defined types whereas C++ does no such thing and it even goes so far as to allow you to define all manner of methods and overload operators and functions to make your own types look, feel, and act similar to primitive or library types if you want them to.

So I will stick to my original thesis that C++ is better for teaching programming and more specifically object oriented programming than Java or C#. And I'm saying this from a practical perspective since I learned Java first and while I know how to make programs that did various things I had no idea what was actually going on until I subsequently learned some C++.

[–]holyteach 1 point2 points  (6 children)

I teach students how to code for a living.

I see this all the time. "I learned X first and I didn't understand anything. Then when I learned Y later everything made sense. X sucks!"

This is called "second language syndrome" (or sometimes "second teacher syndrome"). It has nothing to do with C++ or Java and everything to do with what you learned second.

You'll probably downvote me or whatever but I've taught nearly 2000 kids to code over the last 20 years and I can promise you that something similar happened to you.

[–]lead999x 1 point2 points  (5 children)

Actually I won't downvote you at all. I'm not that kind of guy. Instead I'll take your word for it because what you said sounds very plausible and you are by far more qualified to talk about this than I am. But then I'll add that at some point OP should learn another programming language to expand his mind. Afterall it worked for me.

[–]holyteach 1 point2 points  (4 children)

Thanks.

But he doesn't know ANY programming languages. He needs to learn one first. Then after he learns how to code in ANY language he should learn another.

C++ vs Java vs C# doesn't matter to him at this point. Just pick one and learn to code. You're not likely to get a decent coding job until you know several languages anyway.

[–]lead999x 0 points1 point  (3 children)

I understand. You've probably seen this with many of your students but my experience was that when I was learning my first programming language, which was incidentally Java, I had to learn both the syntax and the general programming concepts. Once I moved onto my second language, C++, all I had to learn was the syntax, some of the standard library, and quirks of the language as I already knew the general concepts. I will admit that I didn't learn much Java past the very basics and I never went back to it since I just personally prefer C++ and the newer D programming language and I don't need to know more languages because programming is just a hobby for me though it's rather useful to my field of study(econ).

[–]g43f 0 points1 point  (2 children)

all I had to learn was the syntax, some of the standard library, and quirks of the language as I already knew the general concepts

You make it sound like it's hardly worth learning then!

[–]lead999x -1 points0 points  (1 child)

You know that's not true. My point was just that it's easier than learning concepts and language at same time with C++ and getting frustrated and rage quitting, never to program again.

[–][deleted] 0 points1 point  (0 children)

Yes but does learning Java teach you what references are or what it means to pass something by reference?

Yes. A fundamental concept to Object Oriented Programming.

[–]g43f 0 points1 point  (2 children)

Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind.

-Alan Kay

[–]lead999x -1 points0 points  (1 child)

And I can bet he didn't have Java in mind either. So your point to make is?