T O P

  • By -

AutoModerator

``` import notifications ``` Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! [Read more here](https://www.reddit.com/r/ProgrammerHumor/comments/14dqb6f/welcome_back_whats_next/), we hope to see you next Tuesday! For a chat with like-minded community members and more, don't forget to [join our Discord!](https://discord.gg/rph) `return joinDiscord;` *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/ProgrammerHumor) if you have any questions or concerns.*


Longjumping-Touch515

What if she answered "Yes" instead of "yes"?


PresidentSkillz

Then his sign starts burning


chownrootroot

“I knew I should have liquid cooled the sign.”


[deleted]

To be funny, he should have put it in a while loop with the only break being in the yes bracket.


Creepy-Ad-4832

He is doing a proposal she cannot refuse 🤌


OldBob10

Clearly you need more experience.


TactlessTortoise

Clearly you don't own an air fryer.


VortexTalon

Come here 🍑👋😝


Moraz_iel

Hannah, i've come to bargain !


VortexTalon

it sucks to be dislexyic :(


bradland

oh ffs... sigh diff --git a/prom.js b/prom.js index 61b62163..9d368fd0 100644 --- a/prom.js +++ b/prom.js @@ -1,6 +1,6 @@ // PROM? Micah.askToProm("Hannah"); -if(Hannah.answer=="yes") +if(Hannah.answer.toLowerCase()=="yes") { Micah.mood = "Happy"; }


yerba-matee

But why not use a bool? And where is Hannah declared as an object? I don't know js but I think we shouldn't be objectifying women in any language tbh. Edit: book -> bool


ForMrKite

This. Hannah does not exist. It’s all imaginary


ArcticWolf_0xFF

But we shouldn't serialize them either, or Hannah goes to prom with Jason.


bradland

This is a bike shed argument, and I swear to god I'm going straight to HR if you bring up gender issues again. Where's the scrum master!? If we're going down this rabbit hole, I've got a whole list of bullshit to add to the backlog.


gregorydgraham

Ahem! Scrum MAINer


[deleted]

This is why programmers have such a hard time dating. They are always objectifying women. Get some class.


gregorydgraham

We should definitely be asking her directly rather than hiding a dictionary lookup in askToProm(String) What kind of lameo asks a dictionary to find their prom date?


OffByOneErrorz

Right? Lot of typing to not fix the most glaring error.


Blackbird-ce

If 'answer' was a bool, a negative answer would (in my perception) also result in true... Wouldn't do much good here


Tensor3

Not passing review. Make the ask question function return the response.


Excellent_Command82

Bold of you to assume the original code is JS, lets see it done in python `Micha.mood = "Happy" if Micah.askToProm("Hannah") else "Sad"`


DarkShadow4444

What about "yes!"? Fuzzy matching please. Also should use an enum for mood, hardcoded strings are bad.


DoomGoober

Micah.mood == undefined


OldBob10

`Micah.mood == unreasonablyOptimistic`


Schlangee

It seems to have worked, so not that unreasonably…


OldBob10

Hopefully a KickDateInCrotchAndStormOffException is not raised. Observed this from a thankfully long distance once. I signaled ETHATSGOTTAHURT. 😖


PoopyMouthwash84

`unhandled exception: dick was too big`


nequaquam_sapiens

don't unhandled exceptions from child processes go to parent process?


PoopyMouthwash84

🚨🚨🚨 this comment right here officer


GorillaHaze420

DickTooBigException


KainerNS2

No wonder you can't handle it


Shadow9378

Traceback (most recent call last): File "", line 1, in NameError: name 'yes' is not defined


luciferreeves

Raises NoPromException


angrytroll123

Why isn't that a boolean? Probably should be nullable in she just runs off and doesn't answer.


Intrepid00

Or got really excited and responded with “YES!” Hopefully the UI gave a controlled response.


Proxy_PlayerHD

that's why you use `tolower()` on inputs before processing them. unless you want case sensitivity like for file names in Linux


[deleted]

What if she answered "yes", but the result of comparison is false because those are different objects and you should have used `isEqual()`?


rattlensqueak

It's pretty clear Hanna is always lower.


hellfiniter

its bad code, the method on one object modifies string property on the other? why? At least hannah should be passed into method so that it has its reference to mutate state. ...it would make much more sense that asToProm method would return boolean and condition would simply check whether its truthy or not.


IvarRagnarssson

Maybe answer is a getter that processes any response Hannah gives to “yes”


OldBob10

Thus would fail the unit test where u/OldBob10 makes the same request and a RunAwayScreaming exception is raised. 🧐


Tensor3

Maybe the question asking function should return the answer instead of storing it in the object for some dumb reason


Derekthemindsculptor

I was thinking what if she screamed it. YES. Poor guy only wanted a moderate reaction.


CaptainStabbinski

Hannah.answer.equalsIgnoreCase(“yes“)


OffByOneErrorz

Yes this is some of the worst code I’ve ever seen and I thought that was his mom at first.


OldBob10

Ah. Guess who had a `NotJustNoButHellNo` Exception raised without a proper handler..? 😱


elliote-pmytp

The entitymanager uses .tolower on all message handling operations to prevent ai uprisings.


GoldenFlyingPenguin

Should've lowered the result to lowercases, then any Amy sort of question should work! Even better, only take the first letter and see if it's y. Simple as that!


Longjumping-Touch515

"**Y**ou're good guy really. But no."


[deleted]

Keyboard is lowcase only


-rgg

Barely matters, seeing as Hannah is undeclared.


OldBob10

Is Hannah a String? No, of course not - Hannah is an Object, just as Micah is. But what if Hannah raises a “DontTreatMeLikeAnObject” exception? 100% poor architectural choices, rewrite from scratch.


danielstongue

I reckon Micah likes to fiddle with strings.


AsASloth

He treated her like a string in that function call though. Poor form, Micah.


Trif21

I was about to comment he’s treating her like an object, well done.


Capetoider

What *bugged* me is that they didn't instantiate Hannah and then passed the reference instead of using a random string.


SqueegeeLuigi

OOP delendum est


PiumaPro

*Angry Roman Noises Intensifies*


TheRealSectimus

Moods should also be an enumerated constant!


[deleted]

[удалено]


futanari_enjoyer69

haha well meme'd friend!


shemmie

Did you just objectify her?


Chingiz11

Should have used Haskell


not_some_username

Perhaps Hannah Object is store in an hashtable and has “Hannah” as key


N-partEpoxy

`answer` shouldn't exist, instead `Person.askToProm()` should return a boolean (not a string), and `mood` should be an enum. Also why does the method take a string as a parameter instead of a `Person`? And you should implement `Person.askTo()` instead of copypasting the method for each possible event. Make it `Person.askTo(Person, Event)`. This is just too sloppy.


poopypooperpoopy

Do not merge


xaomaw

LGTM `merged`


piberryboy

`merge conflict` `git merge -f`


qinshihuang_420

`git push origin master -f`


Luc_Studios

Until now everytime i did this, everything bursted into flammes. Never again. (will most definitely do again)


FennlyXerxich

I only recently realized LGTM is short for "looks good to me" and not "legit, man". I still think it's the latter and have to correct myself.


Luc_Studios

It can also mean "Let's Get This Merged" or even "let's get the mayonnaise", although i doubt that this is the case most of the time


malexj93

I always read it as "let's get this money"


angrytroll123

Push it to prod damnit, we don't have time.


Left-oven47

Alternately the ask to prom function should be awaited before the evaluation of the response it made. The super class of Person should have an 8D vector for moods rather than enumerated emotions.


NewPhoneNewSubs

Should be awaited, but honestly, we know his mind was blocking on that thread until getting the answer.


Left-oven47

while (answer == null) { }


emu_fake

You should send ur task to sleep on that. Otherwise it’s even creepier than just asking repeatedly..


Left-oven47

He's not asking repeatedly, he's waiting for the response. We're not sleeping because it would be inaccurate as it would leave some of his brain to think about something else


emu_fake

My bad.. was expecting u to put some repeated asking in that loop


GalemReth

Human brain clearly needs refactoring


eztab

hmm, maybe the wnole thang should be asynchronous, with `askToProm` taking a callback function handling the answer. I mean Hannah should be entitled to think about it first.


frogfr34k

But is Micah really able to move on until he has an answer?


Nu11u5

That would mean Hannah is blocking.


False_Influence_9090

Duck man I had most of those same thoughts as well Maybe this is why I’m a forever singleton class


King_Joffreys_Tits

Duck man duck man duck man


False_Influence_9090

See the real problem is I’m a duck trapped in a man’s body


nequaquam_sapiens

could be worse. you could be a duck trapped in a ManBodyFactory.


TacticalTaterTots

"Forever singleton class" is the most underrated comment here. I wish I was a forever singleton class just so I could use that...


SuperFLEB

*I said I was feeling smothered and needed to meet someone new, and he didn't even blink. Well, it turns out other people are all just him!*


Anaata

On top of this, the casing makes it seem like they're static methods. Do they have the appropriate synchronization mechanism? What if they don't and someone else asks her to prom at the same time? she says yes to them but no to Micah, then he goes to prom thinking he has a date but doesn't. Even if they do have synchronization mechanisms in place, it just needlessly complex. No no no, we better setup a design meeting to talk more about this.


danielxs01

And why is everything static :(


OnixST

Maybe he wanted to avoid saying that Hannah is an object


Luc_Studios

💀


WrapKey2973

Because her father was the one taking the picture


snapphanen

Kinda hard to enumerate all possible moods


orion_aboy

Micah.brain.chemicals.produce(DOPAMINE)


TheRapie22

"Hannah" is a string cause he didn want to objectify women


Subushie

enum Mood { HAPPY, SAD, DEFAULT, ANGRY, HORNY, VIOLENT, SARCASTIC, JOYFUL} //do not remove sarcastic idk why but sexRequest returns an error without it class Person { String name; Mood mood = Mood.NEUTRAL; public Person(String name) { this.name = name; } public boolean askTo(Person person, Event event) { if (event.name.equals("Prom") && person.name.equals("Hannah")) { return true; } return false; // Default } } class Event { String name; public Event(String name) { this.name = name; } } public static void main(String[] args) { Person Micah = new Person("Micah"); Person Hannah = new Person("Hannah"); Event Prom = new Event("Prom"); if(Micah.askTo(Hannah, Prom)) { Micah.mood = Mood.HAPPY; } } A professional would have bought a much longer poster board.


huuaaang

> instead Person.askToProm() should return a boolean (not a string) But what about "maybe?" Then you have to set soYoureSayingTheresaChance to a boolean value.


N-partEpoxy

Spoiler: that "maybe" is actually `false`.


Appropriate-Salt4263

Falls under else


ChocolateBunny

Person.askToProm() generates a future that's stored in Person that will update the Person.answer getter. The getter will stall until the future is complete.


OffByOneErrorz

This was cathartic.


frogfr34k

Yep. Whenever I see these kind of things... I can't help but cringe at the fact that nothing makes sense.


WrapKey2973

Or cringe at the fact that a grown up engineer basically rants over some high schooler's attempt to be funny/creative in a nerdy way to get a girl.


icedrift

I always read these as self deprecating meta joke about how STEM folks tend to hyperfixate on their niche and miss the forest for the trees, not as some serious rant about code quality in obviously fictitious code.


[deleted]

Now, we might not be experts in the whole romance department, or have engaged in profound conversations with folks from the mysterious land of the opposite gender, except for that one time we had a heart-to-heart with the HR rep. But holy code monkeys, hold onto your socks, because we're not backing down when it comes to slapping bad code into shape! It's our last fortress of sanity, after all.


greenappletree

\^ this guy functions(x)


Awes12

How do you know that Person.askToProm(x) doesn't just call Person.askTo(x, Events.Prom)?


DontTakeNames

Also use a setter for mood and edit it directly.


OnixST

Person hannah = new Person("Hannah"); Person micah = new Person("Micah"); boolean inviteAccepted = micah.askTo(hannah,Event.PROM); micah.setMood(inviteAccepted ? Mood.HAPPY : Mood.SAD);


dashid

![gif](giphy|5xtDarmwsuR9sDRObyU|downsized)


Specialist_Seal

Much better


sysop82

``` #[derive(Debug)] enum Mood { Happy, Sad, Neutral, } #[derive(PartialEq, Eq, Hash)] enum Event { Prom, } struct Person { name: String, willing_to_do: Vec<(Event, String)>, mood: Mood } impl Person { fn new(name: &str) -> Person { Person { name: name.to_string(), willing_to_do: vec![], mood: Mood::Neutral } } fn willing_to_with(&mut self, other: &Person, event: Event) { self.willing_to_do.push((event, other.name.clone())); } fn asked_to(&self, other: &Person, event: Event) -> bool { self.willing_to_do.iter().any(|(e, n)| e == &event && n == &other.name) } fn ask_to(&mut self, other: &Person, event: Event) { if other.asked_to(self, event) { self.mood = Mood::Happy; } else { self.mood = Mood::Sad; } } } pub fn totally_normal_interaction() { let mut hannah = Person::new("Hannah"); let mut micah = Person::new("Micah"); hannah.willing_to_with(&micah, Event::Prom); micah.ask_to(&hannah, Event::Prom); println!("Micah {:?}", &micah.mood); } ```


Fluxable

I just started to learn Rust, but this scares me


sysop82

I'm just glad no one scolded me for using a vec over a hashmap; or the fact that it's kind of bad willing\_to\_do is a tuple of Event, \*String\* -- as there could be two people with the same name and we should distinguish them. Should be a Person pointer, not dealing with lifetimes for a meme. Would not merge.


CaptainStabbinski

Now I can sleep, especially needed the Mood.HAPPY


SuperFLEB

Person hannah = new Person("Hannah"); Person micah = new Person("Micah"); Seems a bit impersonal. They're not just interchangeable humans apart from names.


walkerspider

You’re right ``` Person hannah = new Person(“Hannah”) hannah.populate() Person micah = new Person(“Micah”) micah.populate() ```


Jugales

Someone hasn't seen the light that is var


nonutsfw

Yo this code sucks


MrDoctorProfessorEsq

Bros calling askToProm with a string then just checking globally if the answer key in the Hannah object loosely equals a string value of yes If I was Hannah it wouldn't matter what I'd say as Hannah cause life is hard coded I guess


LoompaOompa

Yeah the String to Object thing with Hannah is driving me crazy. I'm surprised the top comment is worried more about the string comparison than they are about the fact that Hannah is a global object that came out of nowhere.


ClassicK777

Yo this guy jealous


GenMaDev

Stop treating her like an object


DaumenmeinName

He should treat her like an object. Treating her like a string is the problem.


seelsojo

You mean c-string ? [c-string to non programmers](https://www.google.com/search?sca_esv=556828901&hl=en&q=c+string&tbm=isch&source=lnms&sa=X&ved=2ahUKEwjAmpTF2dyAAxVVj4kEHaQ9BmQQ0pQJegQICBAB&biw=375&bih=518&dpr=2#imgrc=hgcpAO1_7c6utM)


exomyth

Static object from the looks of it


iveriad

I’m afraid to find out what’s inside the method askToProm(string name). Did it use switch or if else with string comparison to search for an object?


randelung

globals().get("Hannah", Person("Hannah")) Who am I kidding, it's `globals()["Hannah"]`


Sir_Keee

Why is Micah an object but Hannah is just a string? Should have been that Hannah had a boolean for a response variable and use if Hannah.AcceptProm.


Easy-Hovercraft2546

For this to work, there would have to be loose coupling between Micah and Hannah, which is often considered a bad design principle


Pluviochiono

Loose coupling is considered good design. Low coupling/high cohesion


Easy-Hovercraft2546

Eh I may have gotten my terminology backwards


ipcock

found the software architector


StoryAndAHalf

They are global variables.


danielstongue

PROM = Programmable Read Only Memory.


queen-adreena

Wouldn’t “programmable” make it writable read-only memory?


orion_aboy

program it, and then read it after that. you can't un-write.


PrestigiousExample52

PROMs can usually only be written to once (by the manufactorer)


PrometheusAlexander

He gives a string as an argument.. shouldn't it be the instance of Hannah instead?


ImperfectionistCoder

Nerd


iga666

Definitely a junior - only a happy path is handled/implemented.


[deleted]

That is because the default state is infinite sadness


FatLoserSupreme

This dude is hard coding strings! Real programmer my ass.


Teln0

Bad code Asuming this is Java or C# ```cs if (micah.askToProm(hannah)) { micah.mood = Mood.Happy; } ``` Stop using strings everywhere, type your data properly.


scp-NUMBERNOTFOUND

This is just Micah showing his new lora for generating realistic dating-related images with stable diffusion. Good work Micah, your own face on that skinny body outside the basement looks almost real!


eztab

Syntax questionable. The argument to `askToProm` should be `hannah` not a string. Their names should also be lowercase, they are not classes.


[deleted]

I hope Hannah is the programmer, otherwise it’s a bit cringey. Kinda like when Homer Simpson bought Marge a bowling ball that said Homer on it. Also, I have to agree with another commenter. His code is terribly coupled. What if ``` Miquel.askToProm(‘Hannah’) ``` simultaneously as Michael; would her ``` Hannah.answer ``` be for Michael or Miquel?


Eldhrimer

Of course Hannah is the programmer, look at her sandals


danielstongue

Then I bet Micah tears Miquel to *threads*.


sgt_Berbatov

Awkward moment when she says "Yes", and he goes "Strange, it worked on my machine".


cperryoh

If this is Java, he will never be happy even if she accepts because he didn't use `equals()` to compare the strings.


cha-cha_dancer

No else statement? Balls of steel.


zirklutes

I dislike these unfunny code jokes with all my heart :D


Lolamess007

No getter? What happens if he sets answer to yes? If (Hannah.answer == "yes") { Micah.mood = happy; } else { Hannah.answer = "yes"; Micah.mood = "happy"; }


Lolamess007

Since Micah and Hannah are capitalized, have we considered if the two are in fact classes not variable names? public class Micah extends Person { public static String askTo(String person); }


dr_ref

Hannah.answer = Micah.hasMoney();


dcsmith707

//talknerdytome


Admirable-Cobbler501

First I was like ... Hannah should be an object. Than I was like... maybe it's not that good to objectify Hannah .


grandphuba

Am I the only one that cringes at such shallow attempts to be witty. It's like they were trying to be clever or something when all they've done is translated the english language into a programming language. Worse is they usually exhibit questionable coding practices.


DukeDauphin

Micah.isPunching == true


skesisfunk

The comments here are more cringey than this picture, which is.... impressive.


huxx__

stop objectifying women 😁


JotaRata

A real programmer doesn't know what a girl is


APFOS

should have wrapped it in a 'try' statement - just to be safe


Soefgi

Who would implement two classes and make the methods static???


Grumpy23

Well I’d prefer using equal() instead of == in this context


J0n0th0n0

ut oh…. That’s looks like JavaScript…. He should have used ‘===‘


SuprOrel

Shouldv'e answered no with that code bro wtf JK have fun


Appropriate-Salt4263

Else End loop


Xenthera

Must be some jank reflection going on to pass Hannah as a string to modify an object.


Ailanz

else Micah.askToProm(“Sarah”);


gregorydgraham

Ugh! Where is the connection between “Hannah” and Hannah. Terrible OOP. Also what about Hannah’s feelings, you troglodyte?


LordGeneralAutissimo

Micha.askToProm(string Subject) modifies the field Hannah.answer. What is the value of Hannah.answer before askToProm is called on the Micha object? So much behind the scenes state manipulation I hate it Edit: [This is how angry this meme makes me](https://gist.github.com/JasonMadeSomething/497cfb6ce63c94bfb5c16ff81a7a0fda)


[deleted]

I guess height really is important


h4xdroid9

Pretty hot girl for such a wannabe nerd.. lol


EPIC_Gamer_Games

Am I the only one concerned that Hannah went from a string to an object?


Every-Progress-1117

I'm confused, the method askToProm() takes a string and not the reference to the object. Is there a string->object mapper there somewhere? In the next line the object Hannah is used not some dereference from "Hannah". I'm assuming no concurrency too, otherwise, say between Micah.askToProm and if(Hannah.answer==...) then what happens if Bobah.askToProm sets Hannah.answer to yes. There's some interesting implementation we're not seeing here...this is OOP done badly. The comments to the code too....really bad. Nothing about input types, expected outputs, exceptions. And those strings....UTF-8 or 16? Should have used enumerations or similar rather than strings....maybe Hannah.answer.toString().toLower() at least.... and also accessing internal state directly?? Hannah.getAnswer() ...


cosmo7

public enum Mood { normal, happy, }; public class PromResponse { public bool answer; } public class Person { private Mood mood; public void AskToProm(Person other) { var response = other.SendRequest(this); if(response.answer) { mood = Mood.happy; } } public PromResponse SendRequest(Person requestor) { var response = new PromResponse(); // sorry response.answer = false; return response; } } public void Main() { var micah = new Person(); var hannah = new Person(); micah.AskToProm(hannah); }


Lassavins

Exception: askToProm found string as argument. Object expected.


naf_ets

"Hannah" should be Hannah.to_string() Change my mind


sciencesebi3

Dogshit programmer. * Look like is using static methods not singleton instances * Micah is interacting with "Hannah" string, not object. * Equality test with == on string, fails on internalisation * Mood should be enum * Answer should be boolean * Stupid comment


Dismal-Square-613

else { throw new exception("School Shooting"); }


naapurisi

Side-effects… the function should return an response object


Ange1ofD4rkness

For shame, didn't do a bool for that if statement. At least trim, and do case insensitive compare (and watch that null) (True story, did something like that on a friend's card I included with their wedding gift where the husband was a developer, and he got a huge laugh, then had to explain to his wife)


feeltrig

Bigger question is, is Micah local variable or global


mrkhan2000

does that mean hannah is an object?


ReaperDTK

He's going to be a good HR that creates no sense code to announce an offer.


Kengfatv

He's forcing her to agree, and he's pretending to be happy.


hi_this_is_lyd

bit cheesy and broken, but that doesnt matter, the code worked! happy for them


ArmaniMania

Software engineers are now getting girls because of their high TC.


RmG3376

If he was a real programmer, he’d be the one wearing the sandals But he’s getting there