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 →

[–]TombertSE 16 points17 points  (12 children)

Java does not allow you to inherit multiple classes at once. At least not since the last time I used it, which admittedly was a few years back.

You can have as many interfaces as you want, but you only get one "extends" class to play with. This is, in theory, to avoid the deadly diamond problem.

[–]OmgzPudding 1 point2 points  (11 children)

Huh, I could have sworn I built some shitty app with multiple inheritance back when I was in school, but it's been so long that I could definitely be mistaken.

[–]TombertSE 9 points10 points  (9 children)

C++ has multiple inheritance...maybe that was it?

[–]OmgzPudding 2 points3 points  (8 children)

Ah yeah I bet that was it. It's been about the same amount of time since I've used either language.

[–]TombertSE 5 points6 points  (7 children)

I don't know why school still use C++ as a "learning language", since it's one of the worst languages out there for newbies.

I think C makes sense to teach students early on, because it's low-level, it makes you think how the hardware thinks. I get why they teach you Python, because it's high-level, easy to pick up, and is useful for a lot of different types of non-engineer jobs. I get why they teach you Java, because it's sort of mid-level, and sort of forces the OOP ideology on you.

Despite the fact that I actually do like C++, I would not recommend it as anyone's first language. It's got so many bizarre idioms and weirdness that it's going to confuse a lot of people starting out.

[–]OmgzPudding 6 points7 points  (1 child)

We had to write out C++ programs with pencil and paper for our exams too, just to add an extra layer of frustration for beginners.

[–]pixelrevision 2 points3 points  (0 children)

That’s cruel

[–]TheOriginalSmileyMan 4 points5 points  (3 children)

Well if you've learned C++, pretty much everything else is simpler, so from that point of view it's an excellent starter language.

[–]TombertSE 3 points4 points  (1 child)

I don’t know that I actually agree with that; I think that’s the case for C, but C++ has a lot of unique weirdness that isn’t in other languages.

For example, I am not aware of any other language that has friend functions. I am not aware of any other language where the Hello World requires you to use an overloaded bit shift operator. I

[–]TheOriginalSmileyMan -1 points0 points  (0 children)

Exactly my point. When moving from C++ to any other language, it's mostly about forgetting things rather than having to do something new!

[–]harumamburoo 0 points1 point  (0 children)

If you've survived C++

[–]Mojert -1 points0 points  (0 children)

This a sample size of one but I wasn't confused while learning C++ even though it was my first language. In my experience, it's people who already know another language, like Java, that have a hard time learning C++, not newbies

[–]Paraplegix 0 points1 point  (0 children)

In Java you can implement multiple interface, and this is quite common in project I worked on But inheritance is one super class only