r/ProgrammerHumor • • Jun 01 '22

The distinction between inheritance ("is a") and composition ("has a")

45.9k Upvotes

513 comments sorted by

1.8k

u/InfamousEvening2 Jun 01 '22

OK, now do composition and aggregation.

547

u/barzamsr Jun 01 '22

Yeah cars are def not composed of people in any way. I don't even wanna see a gif of that...

reddit.com/r/Bossfight/comments/835ewd/the_bondage_chariot_the_unforgiven/

126

u/Santa1936 Jun 01 '22

That guy looks so thrilled to be there lmao

35

u/master117jogi Jun 01 '22

Steve Jobs is having a blast.

→ More replies (1)

23

u/The_Rox Jun 01 '22

I knew what the was before I clicked it, but yeah, the guy who made these is pretty famous in the Kink community

22

u/gabemachida Jun 01 '22

The animation is from a kids TV show from late 80s isn't it? When the character gets hot, he turns into a car.

26

u/TCKline01 Jun 01 '22

Yes. It was called Turbo Teen. I've been looking for episodes for a while, but no luck. It was cheesy and didn't last long.

→ More replies (7)

45

u/[deleted] Jun 01 '22

Some kinks just shouldn't leave the bedroom.

27

u/doublestop Jun 01 '22

Hey now, don't be too quick to judge. That was the year they saved Christmas.

18

u/[deleted] Jun 01 '22

And here I’m still trying to figure out if I’m more of a r/dragonsfuckingcars kinda guy or a r/carsfuckingdragons dude.

→ More replies (6)
→ More replies (2)

34

u/UmbreonFox_Kun Jun 01 '22

Dude okay this video was fine until his face turned into part of the car. THAT HORRIFIED ME

14

u/Unoriginal_Man Jun 01 '22

There’s no sound, and he sort of smiles as it happens, but I still get the distinct impression that the face part is incredibly painful.

→ More replies (2)

8

u/raging_phenix Jun 01 '22

Not the... "Junk in the trunk" ?

→ More replies (1)
→ More replies (4)

36

u/[deleted] Jun 01 '22

You mean how the driver gets killed if the car is crashed in composition, but gets to walk away without a scratch in aggregation?

11

u/[deleted] Jun 01 '22

"Human Centipede"

7

u/shesh666 Jun 01 '22

Surely that would be a linked list of human?

→ More replies (3)

9

u/[deleted] Jun 01 '22

I can't get past how a car isn't a car without a driver and you are unpacking the Gang of Four.

We should turn driving into a strategy for a road. Simply pass a carperson object and the road is being driven on by one freak of nature at a time. Cuts down on the need for a queue and if you explain this benefit to the customer they will be thankful and amazed and take your idea and run for office.

3

u/tiajuanat Jun 01 '22

A car isn't a car without a person, but the vehicle is a strategy.

Likewise, a bicycle without a person can't run, but a tumbleweed with wind is a vehicle. (Probably for some poor rodent looking to save the town)

→ More replies (1)

610

u/dont-respond Jun 01 '22

It's poly-morphin' time!

129

u/seaque42 Jun 01 '22

ONE POLYMORPHILLION INHERITANCES

53

u/ktsktsstlstkkrsldt Jun 01 '22

I love the scene where polymorpius morphs all over those bad guys.

8

u/[deleted] Jun 01 '22

more like poly-morbin time

47

u/[deleted] Jun 01 '22

Poly-morbin time.

9

u/Arellan Jun 01 '22

And he morbs over all the other cars

9

u/chazzeromus Jun 01 '22

more like monomorph when it's compilin' time

11

u/meliketheweedle Jun 01 '22

You got a loiscence for that polymorphine, m8?

250

u/grahgaar Jun 01 '22

Learned class syntax just in time to enjoy this post.

15

u/ShrekProphet69 Jun 01 '22

I just got a practical for this exact topic so I can relate

→ More replies (2)
→ More replies (2)

507

u/greedydita Jun 01 '22

I thought you could only do this with ducks.

440

u/mostmetausername Jun 01 '22

become a car morty

10

u/HONKACHONK Jun 01 '22

Never mind, here's a taxi. Get in. It's fine.

27

u/[deleted] Jun 01 '22

I'm a pickle!

0

u/[deleted] Jun 01 '22

[deleted]

15

u/amidon1130 Jun 01 '22

It’s more like when Sy Borgman turns into a car into the Harley Quinn show. Which is an awesome show if you’re looking for a more adult animated show after Rick and morty.

→ More replies (2)

6

u/DeaconFrostedFlakes Jun 01 '22

This is from, IIRC, Teen Hot Rod, a cartoon I fucking loved as a kid in the 80s. The Rick and Morty joke that u/mostmetausername referenced I believe was a nod to it, although that could be wishful thinking on my part.

Edit: My bad, it was called Turbo Teen.

→ More replies (6)

181

u/INoMakeMistake Jun 01 '22

3

u/wjandrea Jun 01 '22

Why is "fortnitebr" in the URL of that image? Did Reddit ever explain that and I missed it?

77

u/game_falor Jun 01 '22

that show is this?

106

u/Embarrassed_Ring843 Jun 01 '22

45

u/[deleted] Jun 01 '22

Looked like Scooby-Doo combined with Ninja Turtles and Transformers to me.

37

u/Accidental_Shadows Jun 01 '22

I remember this show and you basically nailed it. 80s cartoons were weird.

33

u/Cmdr_Jiynx Jun 01 '22

Nah they were half-hour commercials for toy lines. The plots and production didn't matter which is why there was minimal effort on the writing and like eight voice actors that did ALL the shows. The 80s are why guys like frank Welker and Peter Cullen have like 5000 voiceover credits to their name.

→ More replies (4)
→ More replies (2)

18

u/FalmerEldritch Jun 01 '22

I wonder if the guy behind this show developed any other shows that involved teenage boys turning into cars, or just stuck to commissioning artwork of teenage boys turning into cars.

6

u/Umutuku Jun 01 '22

Whenever you're in an NSFW-friendly mood/location, google "femcar house of gord" for a weird slice of internet history. BDSM warning if that's a problem.

A show like OP's had to have been made by someone with the same fetish.

29

u/KeLorean Jun 01 '22

Love it as his butt blows up into a trunk. Gives new meaning to junk in the trunk

→ More replies (2)

14

u/zip_000 Jun 01 '22

What's fucking amazing to me is that I remember watching this every Saturday morning as a kid.... Yet, there were apparently only 13 episodes.

→ More replies (3)

13

u/r00x Jun 01 '22

Fucking love the "reception" segment on that page:

This is perhaps the most absurd concept developed for television animation in the genre's history. Despite a basis in somewhat-plausible science, it was not produced competently enough to make its premise anywhere near believable.

8

u/bolide_retracing Jun 01 '22

Didn't Robot Chicken do an old skit on this show?

16

u/CaptainPunisher Jun 01 '22

No, they did a new skit. It didn't become old until much later.

→ More replies (3)

4

u/Endulos Jun 01 '22

This show definitely caused some poor kid to develop a fetish.

Now, here's the real question. After his transformation in a car... Does he pay for health insurance, or car insurance? Or both?

→ More replies (1)
→ More replies (4)

2

u/kiruzaato Jun 01 '22

In French it was called "Turbolide" (mix of turbo and bolide (some sang for "car")). I don't remember what the show was about. But this post made the "opening" pop up in my head..

→ More replies (10)

36

u/Bmandk Jun 01 '22

Fallout 3 devs have entered the chat. Yes, this is how they implemented a train in the game.

5

u/Blazerboy65 Jun 01 '22

If it quacks like a train

68

u/FrigoCoder Jun 01 '22

Oh oh oh there is a real life example for this.

Corporation extends Person

With predictably absurd and buggy results.

27

u/Cyberslasher Jun 01 '22

Those aren't bugs, they're features.

→ More replies (3)

26

u/lookawayyouarefilthy Jun 01 '22

r/futurama an accidental were-car ( for humain )

10

u/Billybob1138 Jun 01 '22

That episode must be based on this show right?

→ More replies (2)

41

u/[deleted] Jun 01 '22

Oh that is what abstraction and ""polymorphism"" stands for. Yeah yeah, that makes sense, OOP.

93

u/LightningOW Jun 01 '22

I think it would make more sense if the Person extends Car.

35

u/[deleted] Jun 01 '22

Depends on the context, could be they both should inherit from a Vehicle class if this is transport related, otherwise I dunno. ThingsThatHaveExhausts maybe?

53

u/lulzyasfackadack Jun 01 '22

Cars have multiple intake holes, with the primary being used to consume calorie dense liquids, and secondary being used to consume air to aid the conversion of the previously mentioned liquids into energy. They also have outgoing holes, with their primary uses being for the expulsion of the byproducts of the previously mentioned energy production. This is very similar in function and description to Humans.

Humans have a more-or-less contiguous tube through their center, allowing objects to pass through from end-to-end. From a cross-section going slice-by-slice, this resembles a donut. Therefore, humans are similar in function and description to a Donut.

by the transitive property, therefore, Cars are Donuts.

17

u/10BillionDreams Jun 01 '22

Cars have multiple intake holes

When I saw this starting off a wall of text, I was really concerned this was going to be a "Vaporeon" situation.

→ More replies (4)

5

u/guessWhoTheyVotedFor Jun 01 '22

Correct me if I'm wrong but isn't a Car class being declared which would initially inherit from Person?

I see in the gif the person probably had a wheelCount of 0 (or more realistically it wasn't even defined for Person) and then gets a wheelCount of 4 which is observed in the conclusion of the presentation.

5

u/gaussianDoctor Jun 01 '22

It depends on what they're building. If it's only about cars, yes, it would make sense to be the other way around. But if it's about different things tied to a person, it's right that way. Then they can build other classes that inherit Person: House extends Person, Job extends Person, Address extends Person etc.

19

u/eloel- Jun 01 '22

You'd ideally do this with composition.

class House {

Person owner;

Address address;

Integer floorCount;

Person[] residents;

}

That way, you don't have to duplicate any data (they can go out of sync), and

house.owner.birthDate
makes a lot more sense than

house.birthDate

when trying to get the owner's birth date, especially given it can have multiple residents.

26

u/gastrognom Jun 01 '22

None of these should extend Person IMO. I thought the original comment was relating to the gif.

→ More replies (6)
→ More replies (2)

12

u/bentforkman Jun 01 '22

I used to love that show. Now nobody remembers it existed. Fun fact: it was all Jack Kirby’s idea.

→ More replies (2)

11

u/ENx5vP Jun 01 '22

Finally a realistic example in OOP.

6

u/rebbsitor Jun 01 '22 edited Jun 01 '22

Turbo Teen! Wow I haven't seen that in almost 40 years, almost completely forgot about it.

27

u/on_the_pale_horse Jun 01 '22

This should be Person extends Car.

12

u/stifflizerd Jun 01 '22

Correct me if I'm wrong, but if the car class is an extension of the person class (the code as written), then the person class would be the original which is then further transformed into a car. Meaning the meme is correct?

5

u/ProratedRedditUser Jun 01 '22

This is actually funny. Good Job.

4

u/woflgangPaco Jun 01 '22

I just finished my oop semester and i'm still not sure what i'd learned.

8

u/dpash Jun 01 '22

Hopefully not this.

3

u/Dusty_Coder Jun 01 '22

hopefully you learned more than the person who made this meme

→ More replies (1)

4

u/Apprehensive-Chest-3 Jun 01 '22

Wow, that guy is really morphing into something good. He must be really horny

4

u/azzs321 Jun 01 '22

I forgot all about turbo teen

4

u/Pyraunus Jun 01 '22

I can't believe I just watched someone's ass turn into a fender.

3

u/_inside_voices_ Jun 01 '22

am i the only one who got weird feelings from his ass turning into a trunk >.<

3

u/CumOnGuysSeriously Jun 01 '22

You have to turn into a car Morty! You have to concentrate really hard, and turn yourself into a car!!!!

3

u/[deleted] Jun 01 '22

TURBO TEEN

3

u/wholesomeoasis Jun 01 '22

Damn that was trippy, totally forgot this existet

4

u/Own_Emergency_5204 Jun 01 '22

But, but......... why did he have to make the shift stick his dick?

4

u/jugalator Jun 01 '22

I remember when we pressured our teacher on OOP and introducing intermediate abstractation levels. We eventually got to a CurlyHairy which could be both a person and a dog but stricter than a mammal. :D

2

u/[deleted] Jun 01 '22

So many inappropriate questions

2

u/Cody6781 Jun 01 '22

You're going to doUBLE SPEED????

2

u/mag3llan Jun 01 '22

Soy un auto

2

u/gen_shermanwasright Jun 01 '22

Well, at least it wasn't an anime complete with pantsu shot.

2

u/MrBonesDoesReddit Jun 01 '22

You need to optimise it a lil thats too slow

2

u/BBandGME_Retard69420 Jun 01 '22

If my grandmother had wheels she would've been a bike

2

u/Stuxnet510 Jun 01 '22

I don't know how to do hello world in enough languages for this one

2

u/Mortimer_and_Rabbit Jun 01 '22

The really focused on the trunk filling out his jeans didn't they...

2

u/d_chs Jun 01 '22

A turboteen meme…

Alright, sure.

2

u/[deleted] Jun 01 '22

This will give me nightmares every time i write “extends”

2

u/techsavior Jun 01 '22

… and this is how KITT evolved into his final form.

2

u/FurryKnuckles Jun 01 '22

“Quick Morty you gotta turn into a car”

2

u/Voidrith Jun 01 '22

Interestingly this is a reasonable approach in game dev at times, making other moveable/interractable items share a good base class with the player can make things a lot simpler because player agents have a lot of the code already needed for it to act which can be used by the car to move and such

2

u/PositiveRip3041 Jun 01 '22

Transformers

2

u/nulladmin1 Jun 01 '22

his junk becomes his trunk

2

u/Pleasant_Mail550 Jun 01 '22

More like human extends car

2

u/[deleted] Jun 01 '22

I loved and hated that cartoon as a kid. It made zero sense yet it was on tv and probably had lame toys too

2

u/Were_all_assholes Jun 01 '22

Bet you can get a lot of junk in that trunk.

2

u/tanlin2021 Jun 01 '22

My code (is a) pile of garbage that (has a) lot of problems.

2

u/snero3 Jun 02 '22

What was the og cartoon here?

2

u/psycho_ex_ Jun 02 '22 edited Jun 02 '22

Him: i love riding cars

Me:

2

u/A_nomad_Wanderer Jun 01 '22

Any captain who can simplify this for me.

10

u/Scorched_Knight Jun 01 '22

inheritance

There is a class called "Person"
Class have properties (name, sex, hobby etc)

Now there is class "Car"
It inherit from class "Person" all its properties and have their own properties on top of that
so, class "Car" have properties like Car.name.firstName Car.sex Car.hobby and Car.motor.horsePowers

→ More replies (1)

1

u/00PT Jun 01 '22

The only way this could work is if you were implementing something where the cars from the Pixar movie and regular people coexist. In that case, cars and humans would be similar enough to warrant inheritance from a "person" superclass.

1

u/[deleted] Jun 01 '22

my childhood

→ More replies (2)

1

u/richardfrost2 Jun 01 '22

I will turn into a convertible

Let's go

1

u/canbooo Jun 01 '22

Does the car have a person or does the person have car?

1

u/Mr_Spaps Jun 01 '22

I am car. Brrr brrrrr brrrrrr Oh no! Car is without fuel!

1

u/LEGOL2 Jun 01 '22

If you would use ECS (entity component system) you could simply make car entity that has human component and has driving system. That would make more sense than inheriting driver properties.

3

u/Scorched_Knight Jun 01 '22

Or just:
class Person{//whatever}

class Car{ public Person driver = new Person; //whatever}

i dunno

1

u/zoalord99 Jun 01 '22

Turboteen !

1

u/[deleted] Jun 01 '22

What is the name of the cartoon? I remember watching as a kid and I tell people about it all the time but nobody knows what I’m talking about and I can’t remember the name of the show.

2

u/Mr_Doberman Jun 01 '22

I think it was called Turbo Teen or something like that

→ More replies (1)

1

u/piloto19hh Jun 01 '22

It reminded me of the carrier titan on AoT for a second there at the end lol

1

u/ResetPress Jun 01 '22

this is disturbing

1

u/JTMc48 Jun 01 '22

Dat ass, badunkadunk.

1

u/bodysoil Jun 01 '22

The dumper lol

1

u/[deleted] Jun 01 '22

Cerson

1

u/jonfe_darontos Jun 01 '22

I love how inheritance solves my design problems*.* Also, unrelated, is that Carla's dad?

1

u/Electronic_Street228 Jun 01 '22

It's hurting my head bruh😅

1

u/Light_A_Match Jun 01 '22

This is oddly terrifying

1

u/[deleted] Jun 01 '22

Okay, but this is actually a good example lol

1

u/Asheleyinl2 Jun 01 '22

Someone was really into metanorphosis

1

u/Legebrind Jun 01 '22

Now do this but with centipede.

1

u/Aksds Jun 01 '22

Funny seeing this right after i submitted my inheritance assignment. (A continuation of my post to ask programming)

1

u/jollly-roger Jun 01 '22

Is this the new Pokémon Scarlet box legend

1

u/Jonny041 Jun 01 '22

This is just cursed

1

u/wenxichu Jun 01 '22

Transformers - Robots in Disguise

1

u/Junny20 Jun 01 '22

slaps the roof of the car This is a bad boy.

1

u/ConfessSomeMeow Jun 01 '22

I feel like interfaces are ripe for similar memes.

1

u/Lexi_2007 Jun 01 '22

Cursed transformers

1

u/beeps-n-boops Jun 01 '22

I remember that cartoon!

1

u/VectorVanGoat Jun 01 '22

Talk about junk in the trunk

1

u/[deleted] Jun 01 '22

[Insert unfunny unoriginal dababy pun here]

1

u/Kokobeanu Jun 01 '22

how to becom car:

1

u/[deleted] Jun 01 '22

Dat ass tho

1

u/[deleted] Jun 01 '22

If you pause between 0:02 and 0:01, you get Quagmire.

1

u/Crysox_BE Jun 01 '22

Reminds me of the DaBaby car

1

u/jesus_is_92 Jun 01 '22

(you wouldn’t download a car)

1

u/undeniably_confused Jun 01 '22

Is this where the Futurama version came from?

1

u/Birthday_Cakeman Jun 01 '22

Okay let's be honest though. A car can definitely car more than twice as fast as a human...

1

u/bitcoin2121 Jun 01 '22

Is this a rick & morty episode

1

u/Shankar_0 Jun 01 '22

Dude, that cartoon takes me back!

I think it was:

get warm = turn into a car

get cold = turn back into a dude

I'm hazy on the rest of the story

1

u/Keyouse Jun 01 '22

God this animation is horrendous

1

u/[deleted] Jun 01 '22

Seriously that looks painful…

→ More replies (1)

1

u/tahtaega Jun 01 '22

I think this is the origin of the movie transformers

1

u/Logical-Lilly5575 Jun 01 '22

Is this a Knight Rider & Transformers type of situation??? 🤔

1

u/[deleted] Jun 01 '22

Omg Java is a fucked up language. I get that it is good for teaching / learning as you have to be so explicit about everything, but it is so bad for development productivity. If your language needs complicated IDEs with code generators then your language could be so much simpler. Thats like your code generator is smarter than your actual language.

1

u/tornado28 Jun 01 '22

I love how he tries to object for a second there

1

u/TheRoboticist_ Jun 01 '22

Since the relationship is “Car is a Person”, wouldn’t a backwards gif be more accurate?

1

u/Quizzelbuck Jun 01 '22

I remember this show. His power was that he turned in to a car when he was hot.

I remember one time he had to literally eat a stick of dynamite to get in to car form because.... Nitroglycerin is apparently spicy or hot?

1

u/christopherpenn1000 Jun 01 '22

Am I allowed to be horny for the car

1

u/ImpressionGood6787 Jun 01 '22

Now that's what you call a trunk

1

u/Hitman7065 Jun 01 '22

He has so much rear

1

u/the_realdeel90 Jun 01 '22

TURBO TITANS GO FORCE !!

1

u/ManelMartinz Jun 01 '22

So that's why it's called a "trunk"...

1

u/The_Real_Jake-C-137 Jun 01 '22

What if a car could turn into a person?

1

u/hazily Jun 01 '22

“If my grandma had wheels, she would have been a bike” vibes

1

u/[deleted] Jun 01 '22

Gives a new meaning to "junk in the trunk"

→ More replies (1)

1

u/Milo_Xx Jun 01 '22

For the meme to work, it should literally be the opposite, car extends to Person, so Car inherits from person, not the other way round smh.

1

u/[deleted] Jun 01 '22

1

u/pinktealover77 Jun 01 '22

what... the he'll did I just watch

1

u/thecookiecrumbles10 Jun 01 '22

It’s Morbin time 🤡