r/interestingasfuck Jul 21 '21

Chicken with genetic defect /r/ALL

https://i.redd.it/98g39eh4pjc71.jpg
53k Upvotes

View all comments

Show parent comments

835

u/sniper_cze Jul 21 '21

Too complicated :)

def de-evolution(chicken):
    if Humans.eatingChicken():
        chicken = dinosaur
    return chicken

367

u/Reddit-username_here Jul 21 '21

Also, chicken is just a reference to dinosaur now, instead of being a dinosaur. Hopefully that doesn't cause any bugs down the road.

Well, it's working on my computer, I'm gonna go ahead and commit this, alright?

174

u/shayanzafar Jul 21 '21

No need for unit tests either. If it doesnt work ill just tell the client to use my laptop. Where i have confirmed it is working.

110

u/Reddit-username_here Jul 21 '21

SHIP IT!

47

u/shulatocabron Jul 21 '21

They needed yesterday!

26

u/Reddit-username_here Jul 21 '21

Look man, that's Op's problem. I just write the shit!

22

u/Flauni Jul 21 '21

Sales promised client flying sabretooth tigers

Edit: Just heard from marketing that they’ve already sent out the press release.

3

u/Andrewmundy Jul 21 '21

Our stock price is still falling, mgmt just cut benefits.

4

u/[deleted] Jul 21 '21

Dude, you have a Reddit account. Go to Wallstreetbets and get the apes on it!

2

u/rabbitthethinker Jul 21 '21

Im actually all of your IT people. Just stop! We both know your code is going to explode dino-chicken-sapiens everywhere. So just don't do it today, ok? I'll get beer for us both if you just let today be chill and dont introduce the dino-chicken-sapiens to the test environment.

1

u/Reddit-username_here Jul 21 '21

Ummm, I'm sorry, but if we can do it, we're gonna do it. Just to see if it's possible.

2

u/xslugx Jul 21 '21 edited Jul 21 '21

I don’t always test my code but when I do, I do it in production! /s

3

u/JasonDJ Jul 21 '21

Every company has a fully operational test environment.

Some companies also have a separate prod environment.

2

u/rabbitthethinker Jul 21 '21

It's already in production, isnt it? They...they're like oversized Tribbles with claws! The goggles, they do NOTHING!

2

u/JasonDJ Jul 21 '21

Your programmers were so preoccupied with whether or not they could, they didn't stop to think if they should.

28

u/Dragoarms Jul 21 '21

My life... where half-baked code works perfectly in a sandbox and breaks as soon as I show it off...

2

u/DizzySignificance491 Jul 21 '21

Can you make a Docker instance of a laptop?

17

u/droflah Jul 21 '21

Yeeaaaahhh... I think I'm going to have to insist you create a pull request for this and let the rest of the dev team take a long hard look at it.

2

u/ancientRedDog Jul 21 '21

git push origin master —force

I’m a jedi!

16

u/MrWh1te365 Jul 21 '21

Works on your machine, great. Just deploy straight to prod.

6

u/cantadmittoposting Jul 21 '21

"This might delete our whole prod database".

"Nah, noone would be stupid enough to point a poorly secured delete function at the root folder!"

Entire prod database wiped. ... Surprised Pikachu face.

This one act play brought to you by things that actually happened at work.

3

u/fuckyouswitzerland Jul 21 '21

DBAs, please refresh prd using uat

2

u/naliedel Jul 21 '21

Add some frog DNA. What could go wrong?

2

u/ValidatingUsername Jul 21 '21

If it points to a dinosaur, has access to dinosaur functions, and returns private dinosaur secrets...

2

u/flipmcf Jul 21 '21

Deepcopy was taking too long.

1

u/Reddit-username_here Jul 21 '21

Dude, it's got billions of years to copy, give it a little time, Jesus.

2

u/erlend65 Jul 21 '21

You're about to revolutionize the chicken sandwich as we know it.

1

u/Reddit-username_here Jul 21 '21

"chicken burger"

2

u/bruhred Jul 21 '21 edited Jul 21 '21

pub fn de_evolution(chicken: &Animal, humans: &Monke) -> Animal { if humans.eat_chicken { let new_chic = chicken.clone(); new_chic.type = String::from("dino"); new_chic } else { chicken } }

2

u/Adama0001 Jul 21 '21

Obviously they both expose the IDinosauria interface

2

u/CrazyJony Jul 21 '21

It shouldn’t cause bugs. It should cause dinosaurs. Or chickens.

2

u/nemisys1st Jul 21 '21

Straight to prod!

1

u/cleanRubik Jul 21 '21

Not in C and that’s the only language that matters…

This should be fun. …

1

u/AVeryHeavyBurtation Jul 21 '21

What language works like that?

1

u/keithcody Jul 21 '21

Shouldn’t

chicken = new dinosaur

Cuz of evolution.

14

u/chrstphd Jul 21 '21

return Humans.eatingChicken() ? dinosaur : chicken;

but I already fear the integration tests :-D

2

u/truevelvet Jul 21 '21

Why? It's literally the same

Also the correct python syntax is dinosaur if Humans.eatingChicken() else chicken

1

u/chrstphd Jul 21 '21

I just wrote a possible different syntax, nothing more. And probably not python since I do not write python quite often (but I should probably)

0

u/truevelvet Jul 21 '21

Yup it's definitely not python, I just told you

I was asking why you fear the integration tests but maybe that wasn't related to your code

3

u/chrstphd Jul 21 '21

Sorry, it was a loose try about the fact the integration tests based on "regular" chicken will probably raise some funny results around Butcher.class, MealPackage.class, ChickenWings.class...

;-)

1

u/[deleted] Jul 21 '21

His is c# and maybe java but it could be different in java I'm not sure

1

u/truevelvet Jul 21 '21

Yup that syntax is the same in a lot of languages

Java and javascript share it too

1

u/rockrocka Jul 21 '21

That's the C version

condition ? value_if_true : value_if_false

1

u/chrstphd Jul 21 '21

My example was the Java rendition that picks the "Elvis" operator from C, indeed.

1

u/My_name_is_Chalula Jul 21 '21

Did this animal survive?

10

u/Reddit-username_here Jul 21 '21

Lol, indeed!

4

u/the_real_w00zi Jul 21 '21

Lol, indubitably!

2

u/LeEliteChicken Jul 21 '21
de_evolution = lambda chicken: dinosaur if Humans.eatingChicken() else chicken

de_evolution = lambda chicken: (chicken, dinosaur)[Humans.eatingChicken()]

2

u/Carl_Bravery_Sagan Jul 21 '21 edited Jul 21 '21

Oh god that second one is dirty. And also only works if eatingChicken() returns 1 for True

1

u/LeEliteChicken Jul 21 '21

Oh yeah, hadn't considered that eatingChicken may be returning truthy/falsy values instead of True and False.

2

u/betyouwilldownvoteme Jul 21 '21

Too long :)

def de-evolution(chicken): return (Humans.eatingChicken())?dinosaur:chicken

2

u/Hemi_Blue Jul 21 '21

“Your Coders Were So Preoccupied With Whether Or Not They Could, They Didn’t Stop To Think If They Should.”

https://screenrant.com/memorable-quotes-jurassic-park-franchise/

2

u/szpaceSZ Jul 21 '21

dinosaur out of scope

1

u/Reddit-username_here Jul 21 '21

Because they're extinct, duh.

2

u/RobuxMaster Jul 21 '21

def eatingChicken():

if animal == chicken:

eat(animal)

elif animal == dinosaur:

eat(animal)

return

1

u/mikeluby Jul 21 '21 edited Jul 21 '21
from Classification import Dinosaur


 def de_evolution(chicken: Chicken, humans: Humans):
    if humans.eatingChicken():
        chicken = Dinosaur()
    return chicken

Function names should be lowercase, with words separated by underscores as necessary to improve readability. https://www.python.org/dev/peps/pep-0008/#id45

Decoupling the function to the global Humans object through dependency injection

:D

1

u/xeirxes Jul 21 '21

Unexpected character in Line 1: “-“

1

u/Funkit Jul 21 '21

Nonono you see you don’t edit old code to be better, you just add a shitload of comments like

//I know this sucks but fuck it no time

1

u/_Idk_my_name__ Jul 21 '21

Lua time

If HumansEatChicken() == true then chicken = dinosaur end return chicken

1

u/Kage_Oni Jul 21 '21
10 PRINT "Hello Chicken"

1

u/WalkingPlaces Jul 21 '21

def de-evolution(chicken): return dinosaur if Humans.eatingChicken() else chicken

1

u/aarontbarratt Jul 21 '21
Let chicken = dinosaur

1

u/valkenar Jul 21 '21
def devolve(chicken):
  return dinosaur if Humans.eatingChicken() else chicken

1

u/donnadulcinea Jul 21 '21

I'd add some Elvis operator

def de-evolution(chicken):
    return Humans.eatingChicken()?
       dinosaur:chicken;

1

u/thegentlecat Jul 21 '21
def deEvolution(chicken):
    return Humans.eatingChicken()
        ? dinosaur : chicken

1

u/BakuRetsuX Jul 21 '21

return dinosaur

1

u/McBraas Jul 21 '21

What does the return command mean?

1

u/toolazytofinishmyw Jul 21 '21

you shouldn’t be mutating your input

1

u/KillerBoi935 Jul 21 '21

a yes, coder humor

1

u/tea-and-chill Jul 21 '21

Let's go one more step ;)

def de-evolution(chicken): return Humans.eatingChicken() ? dinosaur : chicken

I have no idea what language this is, but I'm hoping it has ternary operator!

Ps: idk why return isn't going to second line -_-

1

u/viktorq_ Jul 21 '21

String deEvolution(){ return Humans.eatingChicken() ? “dinosaur” : “dinosaur”; }

-1

u/Zeref21 Jul 21 '21

Hey there it's FANGG and we would like to say despite the code being most optimal we regret to inform you that you were not selected because a binary tree was not inverted in this

0

u/flyineko Jul 21 '21
def de-evolution(chicken):  
    return dinosaur if Humans.eatingChicken() else chicken

2

u/sniper_cze Jul 21 '21

To be honest I hate this syntax, I have problems with reading it properly...

0

u/flyineko Jul 21 '21

I just put it in my code to annoy my teammates. There is much more about python that constantly tips me off, so the syntax isn't even that bad.

0

u/a_counterfactual Jul 21 '21

Should have been a lambda.

0

u/Deduction_power Jul 21 '21

The other guy's syntax is correct. He is using the proper if-else syntax. Your syntax will return an error.

1

u/awwyeahbb Jul 21 '21

Your syntax will return an error.

It won't raise an error in Python

0

u/Happy-Adhesiveness-3 Jul 21 '21

Too complicated :)

(chicken) -> {
    if (Humans.eatingChicken()) {return dinosaur;}
    return chicken;
}

0

u/radiantyellow Jul 21 '21

still too complication

def de-evolution(chicken):
    ## what happened to the chicken? doesnt matter
    return dinosaur