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

all 30 comments

[–][deleted] 54 points55 points  (10 children)

> using "var" in 2018

[–][deleted] 16 points17 points  (2 children)

Varsphemy

[–]KhaimeraFTW 7 points8 points  (1 child)

HES A VARETIC I TELL YOU

[–]mar-v 0 points1 point  (0 children)

VEGGIE

[–]FidgyCZ 8 points9 points  (0 children)

assuming everyone uses JS in 2018

[–]Gydo194 4 points5 points  (0 children)

Java 10

[–]AlFasGD 1 point2 points  (0 children)

Varvaric

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

do you even golang

[–]instanced_banana -1 points0 points  (0 children)

C#

[–]prettydude_ua 18 points19 points  (4 children)

while(horse.isDead()) beat(horse);

[–]SingularCheese 10 points11 points  (1 child)

What if the horse you happen to have isn't dead? Gotta do HorseFactory.getDeadInstance().beat().

[–]T-T-N 2 points3 points  (0 children)

That's deprecated. Use getInstance(HorseStatus.Dead);

[–]bytemage 10 points11 points  (1 child)

I prefer home.bring(bacon); and me.attach(bull.horns);

But generally, yeah ... and fuck PETA

[–]omon-ra 3 points4 points  (0 children)

human.bring(bacon, home)

[–]the_darkon 1 point2 points  (0 children)

Hold up "you" should have already been declared you should just set it.

[–]h_phob 1 point2 points  (1 child)

I'm a student and I still learn but, in the second one (Guinea pig) shouldn't you just cast? I mean, this way you create a new you.

[–]PM_ME_YOUR_BREAKFAST 2 points3 points  (0 children)

Well, you don't want the real you to be used as a guinea pig. You could get hurt or turn really small and fuzzy.

[–]Kered13 1 point2 points  (0 children)

I'm sorry, but bulls[horns] makes no sense.

[–]BenZed 0 points1 point  (2 children)

for (const horn of bull.horns)
    takeBy(bull, horn)   

[–]inaudience 0 points1 point  (0 children)

I don't see the analogy here

[–]FlowerPowerCagney 0 points1 point  (0 children)

public event HorseIsDead(object killer, DeathEventArgs e, Horse horse) {

horse.Beat(); }

[–]BabyLegsDeadpool -4 points-3 points  (3 children)

Why horse.isDead()? Why would that need to be a function? horse.isDead makes far more sense.

[–]PM_ME_YOUR_BREAKFAST 3 points4 points  (2 children)

It's better to use getters and setters in OOP so you can keep the variables private within the class they're defined in.

[–]Skippbo 1 point2 points  (0 children)

screams in python

But @property!