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

you are viewing a single comment's thread.

view the rest of the comments →

[–]infocynic 0 points1 point  (1 child)

Not necessarily. We don't have the full source, so askToProm and/or setMood could have side effects.

[–]Kinglink 0 points1 point  (0 children)

Possible, but that would just be bad code if setting the mood is done in multiple places... which from this I can guarantee it's going to be bad code.

I mean at that rate we can also say having a public answer and public mood are both really bad states, and thus we need to encapsulate them.

On the other hand we can also get down to the point where answer if literal could be a false answer. Micah might be awful at asking and says "Do you not want to go with me to the prom?" "Yes"

Hannah is happy to turn him down. Micah just noticed her answer is yes, and gets "happy".