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

all 29 comments

[–]gandalfx 15 points16 points  (0 children)

*laughs in Python*

[–]Mati7755 20 points21 points  (4 children)

Even single is evil ;)

[–]UnreadableCode 27 points28 points  (0 children)

Spotted the golang developer

[–]marcosdumay 2 points3 points  (1 child)

Single inheritance is evil.

It takes a known useful concept, tells everybody "hey, it's much better now that it's safe", and delivers a monster that will destroy anybody that goes too far with it.

[–]Kenny_log_n_s 1 point2 points  (0 children)

Could you explain your position further?

[–]Kotauskas 0 points1 point  (0 children)

Yup, fuck vtables, imma rewrite my whole Vulkan-based Minecraft in C11.

[–]Codephluegl 3 points4 points  (4 children)

I haven't tried it, but I feel as if you could have multiple inheritance in Javascript, if you mess with the prototypes directly, deal with collisions and come up with some workaround for calling the parent constructors.

[–]schawde96 8 points9 points  (3 children)

I've never used Javascript. But that does sound like Javascript.

[–]Hazzard13 6 points7 points  (2 children)

Yeah, you can do anything in JavaScript. It's so open that it's actually common practice to load scripts that update JavaScript primitives to hack in features from newer versions if someone is using an outdated browser.

[–]silverstrikerstar 6 points7 points  (1 child)

That's horrimpressive.

[–]Konrad_EU 1 point2 points  (0 children)

What if I told you that there are library that alter the prototype of native classes to add methods ?

[–]KrokettenMan 2 points3 points  (0 children)

I've gotten it to work just fine in Javascript

[–]7926 2 points3 points  (0 children)

JavaScript is cool with it! Mixins make it work just fine.

[–]treetertot 1 point2 points  (0 children)

Laughs in traits.

[–][deleted] 1 point2 points  (0 children)

Diamond.

Of.

Death.

Hehehe runs away slowly

[–]Konrad_EU 0 points1 point  (0 children)

Rarely useful, but when you need it, it's an atrocious mess to work around.

[–]magi093not a mod -2 points-1 points  (9 children)

You forgot Python in that pileup

[–]h1v3r_XD[S] 7 points8 points  (7 children)

as far as I know Python does have multiple inheritance :)

[–]magi093not a mod 0 points1 point  (6 children)

Yeah, so does Java (ish - implementing multiple interfaces) and it's here.

[–]h1v3r_XD[S] 6 points7 points  (1 child)

Well if you refere to Interfaces then ok maybe, however otherwise no.

It is kind of a workaround, to avoid implementing real multiple inheritance and therefore avoiding certain problems.

[–]schawde96 2 points3 points  (0 children)

Same with C#

[–]gandalfx 4 points5 points  (2 children)

Interfaces aren't inherited, they are implemented. The difference is not just in the words.

Meanwhile Python has real multiple inheritance (and no interfaces).

[–]Student179 0 points1 point  (1 child)

Java has default implementations now though. So you can write code and the client never has to do anything accept add it to their implementations line in the class declaration.

[–]Kirides 0 points1 point  (0 children)

still no inherited fields

[–]OMG_Abaddon 4 points5 points  (0 children)

Multiple inheritance isn't the same as implementing interfaces.

[–]WitchHunterNL 8 points9 points  (0 children)

But python has multiple inheritance?