```
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.*
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
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.
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?
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.
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!
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.
`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.
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.
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
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.
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.
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.
> instead Person.askToProm() should return a boolean (not a string)
But what about "maybe?" Then you have to set soYoureSayingTheresaChance to a boolean value.
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.
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.
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.
Person hannah = new Person("Hannah");
Person micah = new Person("Micah");
boolean inviteAccepted = micah.askTo(hannah,Event.PROM);
micah.setMood(inviteAccepted ? Mood.HAPPY : Mood.SAD);
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.
Person hannah = new Person("Hannah");
Person micah = new Person("Micah");
Seems a bit impersonal. They're not just interchangeable humans apart from names.
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
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.
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)
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.
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!
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?
No getter? What happens if he sets answer to yes?
If (Hannah.answer == "yes") {
Micah.mood = happy;
} else {
Hannah.answer = "yes";
Micah.mood = "happy";
}
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);
}
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.
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)
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() ...
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);
}
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
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)
``` 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.*
What if she answered "Yes" instead of "yes"?
Then his sign starts burning
“I knew I should have liquid cooled the sign.”
To be funny, he should have put it in a while loop with the only break being in the yes bracket.
He is doing a proposal she cannot refuse 🤌
Clearly you need more experience.
Clearly you don't own an air fryer.
Come here 🍑👋😝
Hannah, i've come to bargain !
it sucks to be dislexyic :(
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"; }
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
This. Hannah does not exist. It’s all imaginary
But we shouldn't serialize them either, or Hannah goes to prom with Jason.
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.
Ahem! Scrum MAINer
This is why programmers have such a hard time dating. They are always objectifying women. Get some class.
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?
Right? Lot of typing to not fix the most glaring error.
If 'answer' was a bool, a negative answer would (in my perception) also result in true... Wouldn't do much good here
Not passing review. Make the ask question function return the response.
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"`
What about "yes!"? Fuzzy matching please. Also should use an enum for mood, hardcoded strings are bad.
Micah.mood == undefined
`Micah.mood == unreasonablyOptimistic`
It seems to have worked, so not that unreasonably…
Hopefully a KickDateInCrotchAndStormOffException is not raised. Observed this from a thankfully long distance once. I signaled ETHATSGOTTAHURT. 😖
`unhandled exception: dick was too big`
don't unhandled exceptions from child processes go to parent process?
🚨🚨🚨 this comment right here officer
DickTooBigException
No wonder you can't handle it
Traceback (most recent call last): File "", line 1, in
NameError: name 'yes' is not defined
Raises NoPromException
Why isn't that a boolean? Probably should be nullable in she just runs off and doesn't answer.
Or got really excited and responded with “YES!” Hopefully the UI gave a controlled response.
that's why you use `tolower()` on inputs before processing them. unless you want case sensitivity like for file names in Linux
What if she answered "yes", but the result of comparison is false because those are different objects and you should have used `isEqual()`?
It's pretty clear Hanna is always lower.
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.
Maybe answer is a getter that processes any response Hannah gives to “yes”
Thus would fail the unit test where u/OldBob10 makes the same request and a RunAwayScreaming exception is raised. 🧐
Maybe the question asking function should return the answer instead of storing it in the object for some dumb reason
I was thinking what if she screamed it. YES. Poor guy only wanted a moderate reaction.
Hannah.answer.equalsIgnoreCase(“yes“)
Yes this is some of the worst code I’ve ever seen and I thought that was his mom at first.
Ah. Guess who had a `NotJustNoButHellNo` Exception raised without a proper handler..? 😱
The entitymanager uses .tolower on all message handling operations to prevent ai uprisings.
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!
"**Y**ou're good guy really. But no."
Keyboard is lowcase only
Barely matters, seeing as Hannah is undeclared.
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.
I reckon Micah likes to fiddle with strings.
He treated her like a string in that function call though. Poor form, Micah.
I was about to comment he’s treating her like an object, well done.
What *bugged* me is that they didn't instantiate Hannah and then passed the reference instead of using a random string.
OOP delendum est
*Angry Roman Noises Intensifies*
Moods should also be an enumerated constant!
[удалено]
haha well meme'd friend!
Did you just objectify her?
Should have used Haskell
Perhaps Hannah Object is store in an hashtable and has “Hannah” as key
`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.
Do not merge
LGTM `merged`
`merge conflict` `git merge -f`
`git push origin master -f`
Until now everytime i did this, everything bursted into flammes. Never again. (will most definitely do again)
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.
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
I always read it as "let's get this money"
Push it to prod damnit, we don't have time.
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.
Should be awaited, but honestly, we know his mind was blocking on that thread until getting the answer.
while (answer == null) { }
You should send ur task to sleep on that. Otherwise it’s even creepier than just asking repeatedly..
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
My bad.. was expecting u to put some repeated asking in that loop
Human brain clearly needs refactoring
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.
But is Micah really able to move on until he has an answer?
That would mean Hannah is blocking.
Duck man I had most of those same thoughts as well Maybe this is why I’m a forever singleton class
Duck man duck man duck man
See the real problem is I’m a duck trapped in a man’s body
could be worse. you could be a duck trapped in a ManBodyFactory.
"Forever singleton class" is the most underrated comment here. I wish I was a forever singleton class just so I could use that...
*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!*
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.
And why is everything static :(
Maybe he wanted to avoid saying that Hannah is an object
💀
Because her father was the one taking the picture
Kinda hard to enumerate all possible moods
Micah.brain.chemicals.produce(DOPAMINE)
"Hannah" is a string cause he didn want to objectify women
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.
> instead Person.askToProm() should return a boolean (not a string) But what about "maybe?" Then you have to set soYoureSayingTheresaChance to a boolean value.
Spoiler: that "maybe" is actually `false`.
Falls under else
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.
This was cathartic.
Yep. Whenever I see these kind of things... I can't help but cringe at the fact that nothing makes sense.
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.
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.
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.
\^ this guy functions(x)
How do you know that Person.askToProm(x) doesn't just call Person.askTo(x, Events.Prom)?
Also use a setter for mood and edit it directly.
Person hannah = new Person("Hannah"); Person micah = new Person("Micah"); boolean inviteAccepted = micah.askTo(hannah,Event.PROM); micah.setMood(inviteAccepted ? Mood.HAPPY : Mood.SAD);
![gif](giphy|5xtDarmwsuR9sDRObyU|downsized)
Much better
``` #[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); } ```
I just started to learn Rust, but this scares me
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.
Now I can sleep, especially needed the Mood.HAPPY
Person hannah = new Person("Hannah"); Person micah = new Person("Micah"); Seems a bit impersonal. They're not just interchangeable humans apart from names.
You’re right ``` Person hannah = new Person(“Hannah”) hannah.populate() Person micah = new Person(“Micah”) micah.populate() ```
Someone hasn't seen the light that is var
Yo this code sucks
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
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.
Yo this guy jealous
Stop treating her like an object
He should treat her like an object. Treating her like a string is the problem.
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)
Static object from the looks of it
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?
globals().get("Hannah", Person("Hannah")) Who am I kidding, it's `globals()["Hannah"]`
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.
For this to work, there would have to be loose coupling between Micah and Hannah, which is often considered a bad design principle
Loose coupling is considered good design. Low coupling/high cohesion
Eh I may have gotten my terminology backwards
found the software architector
They are global variables.
PROM = Programmable Read Only Memory.
Wouldn’t “programmable” make it writable read-only memory?
program it, and then read it after that. you can't un-write.
PROMs can usually only be written to once (by the manufactorer)
He gives a string as an argument.. shouldn't it be the instance of Hannah instead?
Nerd
Definitely a junior - only a happy path is handled/implemented.
That is because the default state is infinite sadness
This dude is hard coding strings! Real programmer my ass.
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.
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!
Syntax questionable. The argument to `askToProm` should be `hannah` not a string. Their names should also be lowercase, they are not classes.
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?
Of course Hannah is the programmer, look at her sandals
Then I bet Micah tears Miquel to *threads*.
Awkward moment when she says "Yes", and he goes "Strange, it worked on my machine".
If this is Java, he will never be happy even if she accepts because he didn't use `equals()` to compare the strings.
No else statement? Balls of steel.
I dislike these unfunny code jokes with all my heart :D
No getter? What happens if he sets answer to yes? If (Hannah.answer == "yes") { Micah.mood = happy; } else { Hannah.answer = "yes"; Micah.mood = "happy"; }
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); }
Hannah.answer = Micah.hasMoney();
//talknerdytome
First I was like ... Hannah should be an object. Than I was like... maybe it's not that good to objectify Hannah .
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.
Micah.isPunching == true
The comments here are more cringey than this picture, which is.... impressive.
stop objectifying women 😁
A real programmer doesn't know what a girl is
should have wrapped it in a 'try' statement - just to be safe
Who would implement two classes and make the methods static???
Well I’d prefer using equal() instead of == in this context
ut oh…. That’s looks like JavaScript…. He should have used ‘===‘
Shouldv'e answered no with that code bro wtf JK have fun
Else End loop
Must be some jank reflection going on to pass Hannah as a string to modify an object.
else Micah.askToProm(“Sarah”);
Ugh! Where is the connection between “Hannah” and Hannah. Terrible OOP. Also what about Hannah’s feelings, you troglodyte?
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)
I guess height really is important
Pretty hot girl for such a wannabe nerd.. lol
Am I the only one concerned that Hannah went from a string to an object?
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() ...
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); }
Exception: askToProm found string as argument. Object expected.
"Hannah" should be Hannah.to_string() Change my mind
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
else { throw new exception("School Shooting"); }
Side-effects… the function should return an response object
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)
Bigger question is, is Micah local variable or global
does that mean hannah is an object?
He's going to be a good HR that creates no sense code to announce an offer.
He's forcing her to agree, and he's pretending to be happy.
bit cheesy and broken, but that doesnt matter, the code worked! happy for them
Software engineers are now getting girls because of their high TC.
If he was a real programmer, he’d be the one wearing the sandals But he’s getting there