r/interestingasfuck Jul 21 '21

Chicken with genetic defect /r/ALL

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

View all comments

8k

u/anttisaarenpaa1 Jul 21 '21

Abandon chicken, return to dinosaur

1k

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

Edit: probably shouldn't have camel cased that method name, ey?

Edit 2: thanks for the award stranger! I'm on the beta of the 3rd party app I use and it hasn't been getting the award messages from Reddit recently, so I can't thank you privately!

835

u/sniper_cze Jul 21 '21

Too complicated :)

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

15

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?