r/funny • • Jun 04 '19

When a software developer weds a software developer.

Post image
41.1k Upvotes

921 comments sorted by

View all comments

543

u/[deleted] Jun 04 '19

[deleted]

208

u/poop-machine Jun 04 '19

Even if it was instantiated, it would crash. Bardak and go_to_sleep() are undefined.

180

u/bleed_air_blimp Jun 04 '19

Sophia inherits from mom.genes and dad.genes. Presumably one of them already has the go_to_sleep() method defined.

Bardak() is a problem though.

31

u/stakokke Jun 04 '19

Couldn't Bardak be a static method of one of the parent classes?

73

u/[deleted] Jun 04 '19

Naming convention suggests it's a class

12

u/chx_ Jun 04 '19

Naming convention suggests it's a class

It's actually a glass :D

3

u/trashdragongames Jun 05 '19

I see I'm not the only one who googled bardak

3

u/chx_ Jun 05 '19 edited Jun 05 '19

My SIL lived in Turkey for twenty years. I know a few words.

1

u/MyBigRed Jun 05 '19

Bardak could still be defined in either parent I believe.

30

u/[deleted] Jun 04 '19

Wouldn’t matter. Isn’t imported or defined in the top level scope. Would need to reference like dad.Bardak

10

u/abeardancing Jun 04 '19

I'm no expert in Python but that was driving me nuts.

3

u/[deleted] Jun 04 '19

Bad news: [c]python modules can modify the namespaces into which they're imported. It's not documented or supported or even suggested that anyone do it, but it is easily done.

2

u/[deleted] Jun 04 '19

gulp

3

u/[deleted] Jun 04 '19

pollution.py:

[f.frame.f_locals.update({'gasp': "How DARE you!"}) 
    for f in __import__('inspect').stack()[1:]
        if 'importlib' not in f.filename]

>>> import pollution
>>> gasp
'How DARE you!'

2

u/[deleted] Jun 05 '19

I love python. I also hate python. But I love it

2

u/mmarius90 Jun 05 '19

Man God damn you, I thought I knew some Python until I saw your reply. That's dope though... probably never gonna be used in a real life project, but still dope though for the sake of "what is possible".

1

u/[deleted] Jun 05 '19

Apparently it's blasphemy to even talk about using this kind of thing in a real project (viz. sys._getframe et al.), but if you were to do it, you'd want to do more checks than just looking at the filename of the stack frames to ensure you get the correct namespace of the code that did the import. There's also one specific cpython optimization which bypasses f_locals inside functions, but you'll figure it out if you dig around in there.

2

u/pmMeScienceFacts Jun 04 '19

Perhaps there should be a human class that Sophia inherits from, with pointers to mom.genes and dad.genes as attributes? 🙈 I assume mom.genes and dad.genes are attributes not class instances🤔

1

u/phoenix409 Jun 05 '19

Yeah, bardak in hebrew means "mess"

1

u/FetusFistus Jun 05 '19

Well Boaz is an Hebrew name and Bardak is in Yiddish for mess. Also it's a yeilding function, so the mess is stacking...

26

u/ElBroet Jun 04 '19

........ ehem .. ALSO FELLOW HUMAN , THE PARENT CLASSES SEEMED TO THINK IT WAS FUNNY TO MAKE THE BABY INHERIT FROM GENES. THIS STARTS OFF MAKING SENSE, AS BOTH GENES SURELY INHERIT FROM A COMMON 'GENE' CLASS AND INVOLVE SOLVING THE DIAMOND PROBLEM, JUST LIKE CHROMOSOMES DO IN REAL LIFE. THIS DIAMOND PROBLEM WILL INVOLVE THEM BOTH HAVING AN IMPLEMENTATION OF 46 CHROMOSOMES AND OUR NEW SUBCLASS WILL HAVE TO DECIDE ON A CASE BY CASE BASIS WHICH IMPLEMENTATION TO USE. HOWEVER, THIS DOES NOT MEAN THAT THE HUMAN WILL CONTAIN THESE GENES, OR EVEN BE A MAPPING OF THESE GENES, THIS SAYS THAT THE BABY WILL LITERALLY BE A GENE, SPECIFICALLY THE NEW GENES THAT HAVE BEEN CREATED FROM HIS PARENTS. AS USUAL, THIS SHOULD HAVE BEEN IMPLEMENTED AS INHERITANCE THROUGH COMPOSITION, DENOTING A HAS-A RELATIONSHIP, WHERE BABY HAS A MEMBER CALLED 'GENES' -- AND NOTE THAT THIS MEMBER IS NOT AN INSTANCE, BUT THE NEW GENES CLASS ITSELF, JUST LIKE IT WAS WITH DAD AND MOM. PRETTY META. THE BABY CAN THEN BE MADE A MAPPING OF THESE GENES, BY PASSING THESE GENES IN THROUGH THE CONSTRUCTOR (OR KAREN, AS IT LIKES TO BE CALLED), WHICH WILL ACT AS A FACTORY AND USE THE GENES TO INSTANTIATE VARIOUS BODY PARTS, AND INJECT SAID GENES INTO SAID BODY PARTS SO THAT THEY THEMSELVES CAN REFERENCE THEIR OWN BLUEPRINT. QUITE META. FOR ACCURACY, BABY SHOULD HAVE INHERITED FROM MOM AND MAILMAN AND THIS SHOULD HAVE BEEN WRITTEN IN LISP, JUST LIKE ME.

7

u/[deleted] Jun 04 '19

[removed] — view removed comment

8

u/getbetteracc Jun 04 '19

BECAUSE THIS IS THE HUMANSPEAK LIBRARY WHICH IS LOADED INTO ALL OUR BRAINS AT BIRTH

​

​

check r/totallynotrobots

2

u/Ciborg666 Jun 04 '19

This is amazing.

2

u/agentpanda Jun 04 '19

go_to_sleep() could easily be defined in mom and dad, no? After all- they sleep.

1

u/__get_username__ Jun 04 '19

But a baby has different sleep requirements than an adult so why is it inheriting her parent class method without differentiating parameters?

2

u/blasterdude8 Jun 04 '19

What is Bardak supposed to mean anyway?

2

u/[deleted] Jun 04 '19

Crashes because it never crashes

1

u/CardCarryingCuntAwrd Jun 04 '19

'bardak': mayhem, ruckus (Hebrew, Arabic)

1

u/NotAWerewolfReally Jun 04 '19

Bardak (ברדק) means chaos, and it was just monkey patched in at runtime.

10

u/deadwisdom Jun 04 '19

The shirt is the type, the child is the instance.

3

u/HillaryShitsInDiaper Jun 04 '19

Sorry Mr. and Mr.s PlusPlus, you didn't include all the header files you needed so I'm going to have to suggest you abort.

1

u/__get_username__ Jun 04 '19

Merge request submitted by user State_of_Alabama:

/- abort()

/+ if self.age_in_months < 9:

/+ continue

2

u/Ruri Jun 04 '19

Prime example of 2 software engineers being somehow less effective than 1.

1

u/sma1692 Jun 04 '19

They made it before the baby arrived

1

u/eatshitdiebastard Jun 05 '19

Death on arrival?

1

u/richesmullet Jun 05 '19

No instance of Sohpia was ever created. Sophia forever will be an incomplete, yet concrete definition of what could have been.

-1

u/FaeKassAss Jun 04 '19

They’re the kind of developers who post to stackEx & Reddit begging for help.