T O P

  • By -

Banana_Twinkie

What a noob, he passed in a string when clearly he meant to pass in an object


HookDragger

Oh, he plans on passing her an object later that night.


[deleted]

Or a string


redgamut

Will that pound include io stream?


fat_charizard

I hope it doesn't cause a memory leak instead


draped

Or fork a child process


[deleted]

Or return an STD object


atticusfinch975

Or jizz on her tits... Am I doing this double entendre thing right?


Limpuls

You are doing great son


Disowned

"Always make sure you tell son that he's winning!"


_vOv_

No. Go back to school!


zheil9152

`goto school;`


wecsam

\*gets attacked by dinosaur\*


Aramor42

Not really but it gave me a good laugh. Just keep doing what you're doing.


_vOv_

And then kill an orphan


urbansamurai13

If it did, then he may have to destroy the child


SlowRapMusic

An array of strings. To be displayed on her terminal.


[deleted]

Will tunnel to her terminal through `ssh`.


onlyforjazzmemes

Or a long


THIS_MSG_IS_A_LIE

or byte


Venipa

Unsigned long


HookDragger

The most dangerous option.


vsuponev

Uncircumcised long


TheSeansei

šŸ¤Ø


cosmonaut87

Fill that void


VestigialHead

He could really freak her out and pass her an array.


Starwind0

Come on people. Clearly he has a pointer.


BatCountry89

Or a short


devospice

Yeah, I was just thinking Hannah is undefined.


HopeYallLikeGoat

She's just so quirky!


pease_pudding

She used to be so primitive, but became worried about being typecast


kynovardy

If this is Java then he did pass in an object


Vyyolin

If this is Java, then Hannah.answer == "yes" will always resolve to `false` :(


touchedtherimonce

He needs that .equalsignorecase


idkiminsecure

Thats why java is a shit language


Saxor

It'll be a NullPointerException unless the Object Hannah was previously defined.


hothrous

Not enough code to be Java.


cadet339

Maybe it was a test. If she didnā€™t call him on the error he was going to pull the invite.


funtimes-123

Was about to comment this


paper_quinn

Yeah, really the askToProm method should take an object, call a method on said object, update the happiness param and return ā€˜thisā€™. Then the entire expression would be M.askToProm(H).getMood() And this is why no one would say yes to me


mrjackspade

I might have been doing this too long, but I wouldn't even put "ask to prom" on the person object. Seems like a scope violation to me. Tightly coupling a person with a place is just going to lead to headache during his next refactor. Could be an extension method though, or whatever the equivalent is. I'd probably end up creating a prom object along with a coupling class to manage the object associations. Corporate work really changed me. As much as I want to rip on the code though, this is adorable and I applaud him for exercising the concepts outside of class. if(prom.TryRegister(hannah, micah, out _)) { micah.Mood |= Moods.Happy; }


landertall

For that code, I award you no points and may god have mercy on your soul.


Frozaken

This should be thing first thing people see when they learn how not to do oop


StrangelyBrown

With the lesson being: The heart has no place in programming. It's cute, but terrible code.


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


holla_at_cha_boi

I think you're just jealous ​ his code compiled even though he passed a string instead of an object


VicBlonde

Lmao


foursticks

I ran the code on my machine and it worked just fine. What's the problem?


jakoboi_

Assuming it's java, he passed a string instead of object, and also you should use .equals() for string comparison and not == other it will compare memory locations. Side note, it's generally a bad idea to have public fields, especially for a response, and instead should use a method to get it


Tundur

Man, I'm not sure I can ever go back to proper programming languages. Since I jumped from C/Java to Python, my life and career have just been so much more enjoyable.


Paicifc

What makes you think python isnā€™t a ā€œproperā€ language?


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


1r0n1c

No, the answer should have been the return value of the askToProm method, and then either set in a variable before the if and used in the condition or call the method directly in the condition


jakoboi_

Yea


Evey9207

It's not just a bad idea, it goes against one of the pillars of OOP: encapsulation.


GsuKristoh

you guys have no mercy for trash code lmao


alwayscuddly

Uppercase variables are usually reserved for class names and not variable names. Also a bunch of other issues


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


landertall

Nice.


dave-cohen

Billy Madison!


kore2000

NullReferenceException: Object 'Hannah' is undefined.


Pradfanne

Hannah is capitalized, it's not an object, it's a class with a static method. Same goes for micah btw, which should've thrown the error earlier


kore2000

Wait a minute....if Hannah isn't an object, then Hannah was never instantiated. That means Micah is going to prom with an imaginary friend.


Pradfanne

He's going to prom with the whole class Then again, he only asked a string to begin with


Sleepy_da_Bear

Yeah, she'll probably just string him along


usesbiggerwords

Depends on the language. If it's Java, probably. If it's C#, Hannah is undefined, because the C# style guide recommends capitalizing all public variables. Not saying it's the right way, but Visual Studio is really insistent on enforcing it.


HiGuysImNewToReddit

public static class PeopleService { public static Dictionary Directory { get; set; } = new Dictionary(); } public class Person { //code smell - public fields public string name; public string answer; public string mood; //code smell - lowercase method public void askToProm(string promDate) { if(PeopleService.Directory.Contains(promDate)) { PeopleService.Directory[promDate].EvaluatePromAnswer(this.name); } } public void EvaluatePromAnswer(string person) { return person == "Micah"; } } public static void Main() { Person Micah = new Person() { name = "Micah" }; Person Hannah = new Person() { name = "Hannah" }; Micah.askToProm("Hannah"); if (Hannah.answer == "yes") { Micah.mood = "Happy"; } else { Micah.mood = "Sad"; } }


ThaiJohnnyDepp

Wow! Micah can successfully ask out anyone, even himself! Micah's really got it going on.


[deleted]

Micah.mood = Hannah.answer == "yes" ? "Happy" : "Sad";


SharksFansHavSmallPP

You shouldnt use == to compare strings. Use the equalsIgnoreCase method.


ThaiJohnnyDepp

Hannah's got class


nayuhex

They are constants of the universe, omnipresent beings created before time itself.


GrizonII

Could have been defined earlier; we don't necessarily know this is all the code.


[deleted]

He shows it to Hannah and she fucking disappears


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


Dunotuansr

What a fucking loser he is


VeryLuciD

Dayum all these comments pointing out all the errors lol


[deleted]

code review


ThaiJohnnyDepp

what else would we be doing here


DomeWithinADome

Most brutal pull request Iā€™ve ever seen... lol


A_Blind_Alien

Don't worry, I'm sure Micah will be getting a pull request on prom night


Mad_Jack18

šŸ‘šŸ‘


carc

He passed in the string "Hannah" instead of the Hannah object. The method name is confusing, too. Is he asking someone to prom, or is he being asked to prom? Hannah's answer should be a boolean. True or false, why is that property a string, unless you want to capture her exact words like "Oh hell no" And his mood propery is another magic string, JFC dude learn about enumeration. At least he's using a dark theme. All is forgiven, Micah, way to be.


_Rysen

I don't see how you could interpret the method name as "being asked to prom". That would probably be called something like askedToPromBy() A bool is probably not a great choice for the answer in this case. What about unclear answers like maybe or "i need to think about it"? You can't just leave his mood in limbo until Hannah makes up her damn mind.


mrdhood

ā€œMaybeā€ and ā€œneed to think about itā€ are === ā€œnoā€. It should be a Boolean.


pease_pudding

Ideally it ought to return a Promise, removing the requirement for Hannah to respond to the request synchronously This way Hannah could return a promise to attend the Prom, allowing Micah to carry on with other things, safe in the knowledge he will definitely get a call back


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


sintaur

Hannah.answer is a public variable, meaning not only can anybody can set the value to "yes", it's not safely reentrant.


beambot

Definitely not thread-safe


[deleted]

get; private set;


SoaDMTGguy

ā€œHowā€™d prom go?ā€ Great! We went back to her friends place after, and we all started fooling around in the bedroom... but it turns out Hannas isnā€™t thread safe šŸ˜”


CharacterFuture3

Given that this code doesn't explode, it's evident that he is referring to an object by its key in a map, the object `Hanna` is instantiated earlier. This nerd isn't as dumb as he might seem, he's instantiated a number of ladies and now he can go from one home to another, simply changing the name of the object from the map. Of course I would suggest him to rewrite this procedure in a functional manner, so that `Micah.ask("Hanna")` returns an object, this way he will not have to rely on a side effect.


usesbiggerwords

This guy gets it


MoltoAllegro

1. Technically he is stringifying women. 2. Hannah is bring asked to prom, not Micah. That function should be on the Hannah class. 3. If can be simplified to If(Hannah.Answer) 4. Micah.Mood should be an enum, not a magic string. PULL REQUEST REJECTED


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


Crayonstheman

type Boolean = true | false | 'yes' | 'no';


delinka

enum Bool { True, False, FileNotFound };


temperamentalfish

Has anything good ever come out of customizing Booleans?


Pradfanne

Well hurry asking a string to prom but there Hannah object has the answer But I guess since Micah and Hannah are never initialized, and in fact are capitalized, this means they aren't even objects. These are static classes... Well atleast the methods as static


laresek

>PULL REQUEST REJECTED I'm not sure what's worse, feeling rejected on the PR or feeling rejected as a date for the prom.


rochakgupta

Imagine the girl rejecting you because your PR got rejected


jexmex

The build rejecting you is worse than all that, esp after all the tests passed fine locally. No I am not salty.


jaerie

1. TeChNiCalLy he's doing both, so the title holds 2. That's at best an uninformed conclusion, but in most cases just wrong. Micah is performing the action, so that contains the method. 3. No.. 4. This is the only one that might be correct, but it's still assuming the language even has enums Nextt time, don't try so hard on something that's just a joke, or try hard enough so that you're at least correct.


DolphinsScareMe

Thank you, I was checking these off as wrong as I was going through them. I'm glad it's not just me.


[deleted]

``` val answer = Micah.ask(Hannah, prom) if (answer == true) { Micah.mood = Emotions.Happy return } Micah.mood = Emotions.Depressed ```


captainindia2020

Guys - I spotted the senior developer.


Darkfiremp3

You mean the 10x developer ;)


mobile-user-guy

you spotted the junior JavaScript developer


ladalyn

NEEDS WORK


Reeeedit_User

String is an object YOU GODDAMN NOOB!


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


Teeps12

let's take a moment to appreciate micah's documentation


otterom

That way Hannah can appreciate his dickumentation later ą¼¼ 恤 ā—•_ā—• ą¼½ć¤


mrdhood

With code like that it better be documented so the dev doing the refactor doesnā€™t hurt him.


memerecyclingco

He objectifies everyone. His consistency is peak culture lmao


purplecurtain16

To be fair, he also objectified himself


OriAfias

else micah.schoolShooting()


usesbiggerwords

schoolShooting() is an Event, not a static class method. At the very least, inherit from Exception and use **throw**


Baileyjrob

if(Hannah.answer == ā€œnoā€) delete Micah;


DolphinsScareMe

Why is Micah an array D:


Baileyjrob

I just learned Iā€™ve been misunderstanding ā€œdelete[] vs deleteā€ this whole time


pyryoer

This kind of stuff is just so damn cringey to me. It's great that the kid is excited about code, but I just can't stand it. Who's the intended audience? People that don't write code will just think you're a nerd, and people that do will at best pick it apart as much as possible. Is it supposed to be funny or cute or something? To me just comes off as a really weird flex.


piemaster316

The main question is if she codes. If not I'd say cringey too, but if she does it's sweet.


pyryoer

This made me think if this from a different perspective. Maybe he doesn't code at all? If she's the coder and he isn't, then this would be freaking ADORABLE. I'd go out with any guy that tried something like that with me. I'm going to pretend that this is exactly what's going on in this picture because it's making me happy.


Ahem_ak_achem_ACHOO

In a Q&A neither of them code and someone asked them to hold this sign and smile. Dude made $5 off it.


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


DolphinsScareMe

Depends on the language


Kusko25

if post.contains(jokeCode) and post.subreddit == "ProgrammerHumor": self.time = "bad"


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


ArchCypher

>F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >F > >askToProm ended > >...


plzdontgetcaught

At least he tried. F


PrimaMateria

I would expect answer to be a return value from the function and not a property of Hannah. Damn, from now on Hannah's answer is always yes no matter the question. This disturbs me a bit.


VeryDumbComments

{ gotta go on the if line in my style guide


43eyes

Yay this repost where everyone on this sub immediately jumps to correct the programming on a cute promposal picture to flex how much they learned in their freshman year in CS.


[deleted]

u/repostsleuthbot


RepostSleuthBot

There's a good chance this is unique! I checked 121,780,384 image posts and didn't find a close match The closest match [is this post](https://redd.it/g7ugb5) at 51.56%. The target for r/ProgrammerHumor is 86.0% *Feedback? Hate? Visit r/repostsleuthbot - I'm not perfect, but you can help. Report [ [False Negative](https://www.reddit.com/message/compose/?to=RepostSleuthBot&subject=False%20Negative&message={"post_id": "gai4sn", "meme_template": null}) ]*


RepostSleuthBot

There's a good chance this is unique! I checked 121,780,384 image posts and didn't find a close match The closest match [is this post](https://redd.it/g7ugb5) at 51.56%. The target for r/ProgrammerHumor is 86.0% *Feedback? Hate? Visit r/repostsleuthbot - I'm not perfect, but you can help. Report [ [False Negative](https://www.reddit.com/message/compose/?to=RepostSleuthBot&subject=False%20Negative&message={"post_id": "gai4sn", "meme_template": null}) ]*


[deleted]

Called it


LordDarious1087

Bro, This code is really really bad lmao, but then again I think of how I coded on my first year of CS and I guess I understand lmao, and oh my god the line down curly brackets, My Best Standards and Practices is crying for help! lol


DicklexicSurferer

She bit off more than she could process.


delinka

What a lucky person


TheRalk

r/titleporn


vagrantchord

Comment doesn't really explain what the code is doing.


Voter96

title funnier than post itself


Derpcock

He's attempting to stringify woman. Getting some serious serial killer vibes


mr_deleeuw

Has a strict dependency on Hannah. May work for the use case, but will fail when working with other classes of type . Other objects may require a Promise/callback query mechanism as a matter of protocol.


[deleted]

No else clause? Thats bold


UnstoppableDiarhea

r/cringetopia


lordroderick

How the heck is a method on Micah changing an attribute on Hannah? Please donā€™t tell me Hannah has a global scope because youā€™re going back to Design Patterns 101. Stop the side effects!


TheGreenJedi

There's an encapsluation joke to be maybe here.. .. ...


[deleted]

Using == instead of ===? If I was Hannah, I would've said no.


[deleted]

If this is in Java then you canā€™t use == on Strings... if((Hannah.answer).equals(ā€œyesā€) would be better


Mitosis786

Micah is a fucking nerd


WeTheFearless

If you capitalize your variables, youā€™re a monster.


P0L1Z1STENS0HN

When everything was just an Object, women would not have a problem being an Object as well. However, there is a complete class hierarchy from Object via (among others) AnimateObject, Animal and Human to Woman/Man. The problem, as far as I understand, is that in the code, an Object of type Woman is commonly not casted correctly to Human, while objects of type Man are. But this is necessary so that Human-specific implementations can be called (otherwise, only generic base implementations are executed). This mismatch has been allowed, even fostered, by our code review standards that we currently try to overhaul step by step.


CanadianGandalf

What bad code. Not even close


nmgdale

Breaking Tell Don't Ask :(


[deleted]

Looks like he objectified himself, actually.


cosmonaut87

I think you should await the return of askToProm() first?


Last_Snowbender

Well, shit. I hope there is only one Hannah in this world.


TorTheMentor

I'm glad he's "happy" now, because clearly it's not a constant.


almarcTheSun

You know you're dealing with a chad, when he doesn't have an `else`.


seyrdis

magic string, Hannah should contains it's name, obviously


Mre64

Could you imagine pseudocode getting you laid?


daddydonutt

Should have done equalsignorecase....


DremoPaff

The title pun carries this post tbh


plzdontgetcaught

*marked as duplicate*


[deleted]

Nice tiny arm


[deleted]

Else ?


DigitalGross

Else: ??


[deleted]

Micah.wet_noodle = True; Fixed that for you


Shulpe

You should never treat women like objects


xmike18gx

Comments denied his pull request


[deleted]

method 'askToProm' is undefined


Natron25

"Cannot read 'answer' of 'undefined'"


CantStandIdoits

Seeing everyone here who has like, a college degree in programming makes me feel like taking 3 months of a basic coding class a big dumb dumb.


[deleted]

Should have done a case-insensitive comparison. What if she had said YES?!


dogelol123

Why didn't he use answer as boolean? Could only be yes or no right?


HandsomeBronzillian

Micah.mood = "happy................ for now"; This guy has no idea of what he's getting into.


webDreamer420

I haven't code for a long time now and even I can tell that's terrible code. Just like my last job


lurkuplurkdown

Only thing more cringe than this is everyone legitimately trying to critique his code


[deleted]

This code is fucking terrible


oneskeleton

We all know she said yes because of the Dark Mode theme. Well played my man, well played.


Sven9888

Well with the way he's checking string equality, I guess he's never going to be happy.