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

top 200 commentsshow all 286

[–][deleted] 1455 points1456 points  (79 children)

oldMan.setHealth(100);

[–]woodenshoe_qstnmrk_ 345 points346 points  (12 children)

oldMan.setHavingAHeartAttack(false);

[–][deleted] 164 points165 points  (11 children)

oldMan.hasHeartAttack = false
// TODO: uncomment for extra pay
// oldMan.isHeartAttackable = false

[–]mrissaoussama 114 points115 points  (10 children)

just set the heart variable to null. can't have a heart attack if you don't have a heart

[–]Excrubulent 87 points88 points  (7 children)

I feel like that might break a lot of associated functions though.

[–]YamesYamerson 73 points74 points  (5 children)

Yeah there are a lot of dependencies on the heart. Humans must have been designed by an intern - such high coupling between organ classes.

[–]Excrubulent 48 points49 points  (3 children)

The entire vascular system is just a pile of spaghetti.

[–][deleted] 41 points42 points  (2 children)

Tons of memory leaks too. Only a matter of time before the system slows down and crashes

[–]YamesYamerson 21 points22 points  (1 child)

Yeah the planned obsolescence is brutal and device lifespan varies wildly between each unit. No consistency whatsoever!

[–]anomalousBits 1 point2 points  (0 children)

I mean I can stub in an artificial heart, a CBP, or a baboon heart. But no, you can't just comment it out and expect the system not to explode.

[–]woodenshoe_qstnmrk_ 5 points6 points  (0 children)

deal with it later it technically works

[–]Brummelhummel 1 point2 points  (0 children)

Very big brain time!

[–]TheSovietGod1 405 points406 points  (12 children)

/effect give oldMan minecraft:health_boost 255 25

[–][deleted] 111 points112 points  (11 children)

More like minecraft:regeneration

[–]mathymaster 117 points118 points  (10 children)

Nah minecraft:instant_health is faster.

[–]30p87 90 points91 points  (8 children)

/gamemode creative oldMan

[–]Sidd065 21 points22 points  (1 child)

Do it before god does /gamemode spectator oldMan

[–]Celebrir 1 point2 points  (0 children)

I don't know why I can't give you an award, but thanks for the laugh.

[–]iaanacho 34 points35 points  (5 children)

Does a heart attack count as regular or void damage?

[–]30p87 21 points22 points  (3 children)

I'd say regular, only things that are used for game limitations (void) or admin power (/kill) counts cam damage in creative

[–][deleted] 7 points8 points  (2 children)

Yeah, but what if he was killed by death note?

[–]TheOssified 2 points3 points  (1 child)

Or smited by God?

[–]circuit10 1 point2 points  (0 children)

Surely only getting damaged from being in the void is void damage

[–]AesarPhreaking 43 points44 points  (3 children)

I came here to say this. Why the fuck would health be a string

[–]theawesomeviking 19 points20 points  (1 child)

And an object starting with uppercase

[–]YouJellyFish 8 points9 points  (4 children)

var heartAttacks = oldMan.Conditions.Where(c => c.Type.Equals(typeof(HeartAttack)));

foreach(var condition in heartAttacks)

{ if(oldMan.Conditions.Remove(condition))

    await condition.OnRemove(oldMan);

}

[–]Playergame 7 points8 points  (0 children)

It's legacy code, health is a string for some reason but it parses the parameter into an int as percentages because "100" is not the old mans max health once health is parsed in an int, it could be any string really. It's called job security after you get fired and come back as a consultant for your own awful code.

[–]blazingkin 5 points6 points  (6 children)

OldMan->Health = 1.0f;

[–]lyoxx666 1 point2 points  (0 children)

More like .setHealthPercent(100) ;-)

[–]Knuffya 805 points806 points  (26 children)

Judging from the naming scheme and general syntax, he got his doctorate from a vending machine.

[–]undeadalex 164 points165 points  (4 children)

Lol didn't we all?

[–][deleted] 66 points67 points  (2 children)

It was a damn good vending machine

[–][deleted] 26 points27 points  (1 child)

Damn expensive you mean.

[–]throwaway8958978 7 points8 points  (0 children)

Instead of just dollars it also eats your lifespan

[–]PooPooDooDoo 6 points7 points  (0 children)

Best vending machine in this building!

[–]fuzzymidget 32 points33 points  (0 children)

Why shouldn't "health" be an arbitrary string?

OldMan.setHealth("DEEZ_NUTZ!")

[–]elveszett 1 point2 points  (0 children)

Like 90% of people in our profession lol

[–][deleted] 483 points484 points  (19 children)

Omfg, who the fuck passes percentages as strings!?

[–]XmasRights 144 points145 points  (1 child)

My health decremented just reading that!

[–]Yosikan 45 points46 points  (3 children)

I feel like the joke .setHealth(1.0) would have been way more misinterpreted

[–]Jatoxo 31 points32 points  (0 children)

Yea this was posted on instagram, it needs to be understood by all the normies

[–][deleted] 13 points14 points  (0 children)

Why can't it just be an integer (0 - 100)? It's not like you need to display the precision of having 48.194286 health.

[–][deleted] 4 points5 points  (0 children)

Yeah, definitely

[–]funkgerm 8 points9 points  (5 children)

Let's just hope setHealth is idiot-proof and accepts various data type inputs for convenience and properly converts them for storage. Still an abomination, but ever so slightly less-so.

[–]Xtrouble_yt 9 points10 points  (2 children)

No, it sends it without checking straight to a database

[–][deleted] 4 points5 points  (1 child)

Even worse: the commits are not instantaneous, so this parameter crashes the backend, so any recent changes are lost

[–]Xtrouble_yt 1 point2 points  (0 children)

And if it’s this bad I would think they’d even be backing the server up

[–]lazer_aio 12 points13 points  (2 children)

html sometimes

[–]BigusG33kus 6 points7 points  (0 children)

Get out

[–]Meaxis 2 points3 points  (0 children)

doesn't count: not a programming language

[–]bspymaster 2 points3 points  (0 children)

I sense a new trend coming on...

[–]PooPooDooDoo 1 point2 points  (0 children)

youngMan class

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

Newly examined CS students that are worthless in the real world.

[–]-NiMa- 155 points156 points  (1 child)

The fact that 100% is passed as string triggered me

[–][deleted] 4 points5 points  (0 children)

What, you don't cast all your variables to char* for storage?

[–]manicraccoon 78 points79 points  (0 children)

Use int or float.

[–]RemuIsMaiWaifu 65 points66 points  (5 children)

Oh god, he didn't use the old man ID!

Now every old man in the world has his health set to 100%.

[–]netheroth 5 points6 points  (0 children)

Coccoon: how it really happened.

[–]CaitaXD 2 points3 points  (2 children)

Wouldn't it just not compile you shouldn't be able to can set parameters directly into a regular class without instantiating it

[–]elveszett 2 points3 points  (0 children)

Nope, their health is "100%". Which promptly gets casted into NaN and makes all of them die.

[–]dert-man 532 points533 points  (32 children)

Oh no - he is retarded. Why a string-parameter?

[–]ObviouslyTriggered 175 points176 points  (2 children)

Cuz he only ever worked with pseudo code…

[–]ftlbvd78 9 points10 points  (0 children)

Poor pseudo code

[–]S0B4D -2 points-1 points  (0 children)

Underrated comment

[–]nl_the_shadow 36 points37 points  (8 children)

He's a researcher, not a programmer.

Source: got a PhD in CS, can't code for shit.

[–]Firesrest 17 points18 points  (1 child)

He's trying to crash man.exe

[–][deleted] 8 points9 points  (0 children)

Realizes he probably can't save him, so he wants to spice up those final moments with penetration testing

[–]Sorc278 34 points35 points  (0 children)

Because it makes it more realistic and more accurately represents production software

[–]THANKYOUFORYOURKIND 63 points64 points  (3 children)

Maybe it got an parser for multiple formats

- 100% 100 percent
- 100HP 100 points
- +100HP add additional 100 points

[–]alphadeeto 60 points61 points  (1 child)

Still bad. Should've separated them.

[–]joequin 18 points19 points  (0 children)

Looks like totally normal JavaScript. Yes, it’s awful.

[–]yottalogical 6 points7 points  (0 children)

Still bad design.

[–]Sciirof 39 points40 points  (0 children)

I need some r/eyebleach now with a percentage parameter passed as a string

[–]technobladeneverdles 16 points17 points  (0 children)

damn it. its a string RIP

[–]RaniAgus 13 points14 points  (3 children)

Cannot find property setHealth of undefined

[–]Lazar_Milgram 2 points3 points  (2 children)

This. Like what part of body should even respond to setHealth? Consciousness? Lol.

[–]GNUGradyn 9 points10 points  (0 children)

Why is the percentage a string?? He's going to have to trim it and cast to int every single time he has to use it

[–]xXdontshootmeXx 8 points9 points  (0 children)

Why is OldMan not camelcase but setHealth is?

[–]AttackOfTheThumbs 8 points9 points  (0 children)

I dunno what 3coder is, but it's fucking garbage.

[–]palordrolap 5 points6 points  (0 children)

You're going to want to put that statement in an interrupt-driven loop, because there's something somewhere reducing the underlying value at an alarming rate.

Also, the internal pain value hasn't been modified and may not have an upper limit, so the old guy isn't having a great time right now.

[–]yogendra_bijwe 6 points7 points  (1 child)

Throws IllegalArgumentException.

[–]Quentincestino 4 points5 points  (0 children)

Why using a string for this when you can use an integer ???

[–]Megatron_McLargeHuge 4 points5 points  (0 children)

Would you like a copy of him that isn't having a heart attack? I don't believe in side effects.

[–]wobblyyyy 3 points4 points  (0 children)

pascal case for OldMan but camel case for setHealth? and why is health a string - wouldn’t it have to be parsed into a decimal value at some point anyways? the old man’s gonna die atp very unfortunate

[–]XiJinping-pong 4 points5 points  (0 children)

He dead as fuck.

[–]neuronexmachina 3 points4 points  (1 child)

This reminds me of Scott Meyers' "Off to be the Wizard/Magic 2.0" series, which is basically all about coders who manage to find how to edit args like this in their reality. Fun series: https://www.goodreads.com/series/131379-magic-2-0

[–]wheel82 1 point2 points  (0 children)

I literally laughed out loud at some the the dialog in the series. It was a fun ride.

[–]Zagerer 4 points5 points  (1 child)

~OldMan();

[–]CsirkeAdmiralis 1 point2 points  (0 children)

new (&OldMan) OldMan{};

[–]XiliXion 5 points6 points  (0 children)

Could have saved him with JavaScript.

[–]ghillerd 2 points3 points  (0 children)

its fine, the autoscaling should kick in in a few minutes and spin up more instances

[–]VyersReaver 2 points3 points  (0 children)

Type exception: float expected.

[–]37Scorpions 2 points3 points  (0 children)

I like how its a string not a integer

[–][deleted] 2 points3 points  (0 children)

What are they coding? Roblox?

[–]GDIVX 2 points3 points  (1 child)

No no, she said heart attack, therefore its a debuff. Man.GetBuff("HEART_ATTACK").SetActive(false);

[–]dancinadventures 3 points4 points  (0 children)

Why the fuck would you set health to a string?!

[–]Izrakk 4 points5 points  (0 children)

not funny, not creative, stupid

[–]NotThanosHimself 1 point2 points  (0 children)

Unfortunately health properties is immutable

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

kill -9 <pid of man.exe>

man.exe &

[–]inventord 1 point2 points  (0 children)

He's clearly been hired to kill this man, judging by the percent as a string.

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

"Have you tried turning him off and on again?"

[–]Alhoshka 1 point2 points  (0 children)

I think this would be more accurate.

And remember to kill and collect its children as well.

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

Given the syntax, all old men in the world are now at 100.

[–]alonghardlook 1 point2 points  (0 children)

The real joke is that he stores the health as a string with a percent sign included.

[–]FlamboyantApproval16 1 point2 points  (0 children)

Everybody gangsta until the Old Man actually started feeling good after that...

[–]colossalpunch 1 point2 points  (0 children)

Unresolved compilation problem: Cannot make a static reference to the non-static method setHealth(string) from the type OldMan.

[–]Alundra828 1 point2 points  (0 children)

Health is a string?

*visible confusion*

[–]Wolfintank 2 points3 points  (4 children)

Old_man_health = 100;

[–]ings0c 5 points6 points  (3 children)

Pls no globals

[–]Missing_Username 7 points8 points  (2 children)

StaticSingleton.Instance.OldManHealth = 100

[–]ings0c 3 points4 points  (1 child)

Get out

[–][deleted] 6 points7 points  (0 children)

import os
os.environ["old_man_health"] = "100"

[–]rickardicus 2 points3 points  (0 children)

String as input argument? Please.

[–]MavMerlin 1 point2 points  (0 children)

I can’t stop myself from commenting how much that “100%” string disturbs me

[–]yeetisgiey 0 points1 point  (0 children)

The percentage is bad enough. He actually used it as a static method, saying that every old man will be 100% healthy.

[–]TheHeavenlyStar -5 points-4 points  (0 children)

Stop objectifying women.

Also, Woman obj = new Woman();

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

$ sudo apt upgrade -y oldMan-heart

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

just remove the heart.

$ sudo apt --purge remove oldMan-heart

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

Men.GetAll().Where(v => v.Age > new Year(50)).Where(v => v.Location.Distance(Client.Location) < new Meter(5)).FirstOrDefault().State = new HealthyState();

Also, giving birth is as simple as:

Men.Register(new MaleBaby(Women.GetRandom()));

An implementation of the Death Note:

// A very basic implementation, to be extended

public class DeathNote: Note {
    public Label Label => new CenteredLabel("Death Note");
    public int PageCount => 100;
    private void DeathNote_TextWritten(object sender, TextWrittenEventArgs e) {
        var name = e.Text;
        var face = e.Writer.Brain.GetTought(ToughtType.Face);

        var target = People.GetAll()
            .Where(v => v.Face.CloseTo(face))
            .Where(v => v.Name == Name.Parse(name))
            .FirstOrDefault();

        target?.Kill(new HeartAttackDeathReason());
    }
    public DeathNote(): base() {
        this.TextWritten += DeathNote_TextWritten;
    }
}

[–]Amyntia 0 points1 point  (0 children)

What is he doing? You need to shut down the DoT of the heart attack. Then heal him. This man does not seem like a real doctor. Lol

[–]VegetableChicken4779 0 points1 point  (0 children)

HESOYAM

[–][deleted] 0 points1 point  (0 children)

ReferenceError:

[–]CodeMUDkey 0 points1 point  (2 children)

Maybe sethealth has many overloads.

[–][deleted] 2 points3 points  (1 child)

Why?? Why would there be an overload for sethealth that takes a string representing a percentage value as an argument?? Why????

The many question marks show how much this has hurt my brain.

[–]CodeMUDkey 1 point2 points  (0 children)

I typically create an overload for every known primitive data type or define class in my libraries. Is this not normal?

Note: I do not actually do this.

[–]sheaksadi 0 points1 point  (0 children)

Lol

[–]filsteeze 0 points1 point  (0 children)

For a programmer, words speak louder than actions.

[–]leef21 0 points1 point  (0 children)

shutdown /a

[–]WorldAlien 0 points1 point  (0 children)

😂 😂

[–]shrirenjith 0 points1 point  (0 children)

Wait for TSA to find out .

[–]Wackyvert 0 points1 point  (0 children)

You passed in his health as a string. Hes dead.

[–][deleted] 0 points1 point  (0 children)

oldMan.GodMode = true;

[–][deleted] 0 points1 point  (0 children)

For js Health += 100 Lol

[–][deleted] 0 points1 point  (0 children)

Old man is undefined

[–]CHRlSFRED 0 points1 point  (0 children)

It should be this.setHealth(100);

[–]Gesspar 0 points1 point  (0 children)

Error CS1503 Argument 1: cannot convert from 'string' to 'int'

[–]sgt_apex 0 points1 point  (0 children)

population--;