The comic is about Cueball confronting Ponytail over her recent behavior and poor emotional state over the past few months. While Ponytail doesn't give any details on what's causing it, it can be inferred that she is referring to the recent election of Donald Trump as President of the United States, which happened about 2 months prior to the publication of this comic. This is a common reaction in the United States whenever a new president is elected, as the voters who did not vote for the new/upcoming President will be feeling unpleasant emotions that their chosen candidate did not win, and will want to express these emotions to the wider world. With the advent of the internet, and more recently social media, the expressions of these emotions have grown more common and often more hyperbolic, regardless of the quality of the candidate.
Ponytail has retreated to video games for solace to the point that her real life projects are suffering.
Stardew Valley is a video game in which a player creates and manages a virtual farm. And when Cueball mentions that her projects have stagnated, she retorts that her farm in the game is doing great. A comic with the name of that game was releases only two weeks later, 1797: Stardew Valley, indicating that it is indeed Randall who has played this game excessively.
Cueball's statement about not being able to hide from everything is a common one to give to insecure people or to those trying to run away from their problems. Ponytail's reply is in the form of a PolitiFact reply, claiming (possibly quite truly) that such assertions are mostly false, one of the six options, but it is far from being the worst, thus acknowledging that you can't hide from everything, just mostly. Politifact.com was also the subject of an earlier comic, 1712: Politifact.
In computer programming, comments are pieces of non-functional, descriptive text that programmers include in their code. Typically, they are used as a form of documentation, to make the code easier for other developers to understand. This is why Cueball is glad that Ponytail is at least writing more comments; documentation is something that's often neglected by developers, despite its usefulness. Unfortunately, the comments that Ponytail is putting in her code are not actually about the code at all; she is, presumably, commenting more generally on whatever is troubling her as a way of venting her issues.
Ponytail's reply to "write what you know" is a common piece of advice given to amateur fiction writers - it means that writers tend to write best when they are writing about something they personally know well, since they will have plenty of interesting and useful experience to draw from. However, since Ponytail's comments are full of obscenities, she is sarcastically suggesting that obscenity is all she currently knows.
Functions are reusable pieces of code which developers create to avoid repetition and make the code more organized. For example, if the code often has to calculate the distance between two points, it makes sense to place that calculation logic into a "calculateDistance" function, which can then just be called whenever it is needed. More generally, a function accepts inputs (eg. the coordinates of two points) and may return an output (eg. the distance between the two points).
Cueball notes, however, that all of the functions Ponytail has written are not actually doing anything with their inputs; they are just returning them straight back again and demanding that the calling code should deal with the problem itself. This makes the functions practically useless. Ponytail sardonically tries to justify this as a functional programming technique by saying that she is "avoiding side effects". A side effect is a situation in programming in which an isolated piece of code changes something about the global state of the program - this can be problematic, as there could be other parts of the code that were not expecting the change, and might behave differently as a result. Their different behavior is a side effect. Sometimes side effects are intentional, but when they are not, they can be tricky to debug and fix.
Functional programming is a programming paradigm in which most or all computation is performed within the scope of self-contained functions, thus avoiding stateful behavior entirely. This removes the possibility of any side effects, since each function only knows what it is told via its inputs, and does not need to be concerned with anything happening outside of itself. Technically, Ponytail is adhering to this paradigm, but only in the sense that her functions are not doing anything at all, and so cannot have side effects.
Cueball fairly makes this point by noting she is avoiding all effects, to which Ponytail quotes part of a famous quote from Ripley in Aliens: I say we take off and nuke the entire site from orbit. It's the only way to be sure. By replying that it's the "only way to be sure" she is thus indirectly saying better safe than sorry, but in reality she just doesn't care about her programming anymore because of her sad state of mind.
The title text is a pun, interpreting the phrase "side effect" literally. If you turn an object 90 degrees along the right axis you will place it on its side, so thus making it a effect of putting something on its side, or a "side effect." You can also turn 90 degrees (along another axis), facing what was previously your side.
Sadness could come from many causes (breaking up, family member dying etc). However, the notion that this comic is political is supported by the fact check in the second panel, and also that this was only the second comic released after Donald Trump's inauguration. This comic gave rise to this page: Sad comics. It was the fourth very sad/negative comic in a bit more than two months after the election and the page describes the relations of these comics and others which relates to election or politics related to Donald Trumps presidency.
- [Cueball is walking up to Ponytail who sits at her desk in an office chair typing on her computer.]
- Cueball: How are you doing?
- Ponytail: Hah.
- Cueball: You seem distant lately. For the past few months.
- Ponytail: Can't imagine why.
- [Cueball talks to Ponytail at her desk from off-panel.]
- Cueball (off-panel): Your projects have stagnated.
- Ponytail: But my Stardew Valley farm is doing great.
- Cueball (off-panel): You can't just hide from everything.
- Ponytail: Fact check: Mostly false.
- [In a frame-less panel Cueball is seen standing behind Ponytail at her desk.]
- Cueball: I'm glad you're including more comments in your code, but it would be nice if they were comments about your code.
- Cueball: Or at least a bit less obscenity-filled.
- Ponytail: Look, they say to write what you know.
- [Cueball leans forward towards Ponytail at her desk (who has looked on the screen in the same position through the entire comic).]
- Cueball: All the functions you've written take everything passed to them and return it unchanged with the comment "No, you deal with this."
- Ponytail: It's a functional programming thing. Avoiding side effects.
- Cueball: You avoid all effects.
- Ponytail: Only way to be sure.
add a comment! ⋅ add a topic (use sparingly)! ⋅ refresh comments!
This comic was made in winter, maybe it's about seasonal affective disorder? Cueball says that she has been sad for a few months.
My first instinct is that Ponytail is feeling despondent about politics. I am reading too much of myself into it? 188.8.131.52 17:25, 25 January 2017 (UTC)
- The title ("Sad" - a common interjection in Trump's tweets) strengthens this argument. 184.108.40.206 (talk) (please sign your comments with ~~~~)
- As does this being a problem that's been going on for the past few months. Contrary to what the explanation says, a programmer creating functions that don't do anything but return the same data back is not 'semi-common in regular life'. That and the title clearly indicate that this is about more than a programmer subverting complaints about their work. Something very bad is going on that has Ponytail, who also just happens to be a woman, depressed and angry. The election seems like the obvious thing. 220.127.116.11 (talk) (please sign your comments with ~~~~)
- My reaction was based on the "Fact Check" reference, which is largely used in politics. 18.104.22.168 18:01, 25 January 2017 (UTC)
Could "sad" could also refer to the medical term "Seasonal Affective Disorder", a condition where people feel depressed during the winter as a result of getting too little sunlight? Mr. I (talk) 20:05, 25 January 2017 (UTC)
- I would have expected it to be in all caps if that were the case 22.214.171.124 20:42, 25 January 2017 (UTC)
- Well in principle it is written in all caps on xkcd, but that is because of the font. If you copy paste the title it does come out Sad. But if you read it on xkcd you would see it as SAD. That is why we have this site to clarify. She (or rather Randall) is really sad, and with the way Trump is going to ruin the US for over half the population many will be really sad. Horrible what he has already started within a week of his inauguration, and with Randall obviously feeling like this too, and even living under him (not like us foreigners) then he is very likely sad. :-( --Kynde (talk) 14:56, 26 January 2017 (UTC)
It is not really true that "side effects" in this context are "unexpected, unintended, and typically unwanted..." A side effect in functional terms is simply an effect other than on the output of the function. As the linked wikipedia article explains, these are very common and typically (but not always) how a program interacts with the outside world. In a pure functional language functions do not have side effects. Ponytail's job may or may not be (but probably isn't) to avoid side effects at all costs. 126.96.36.199 21:23, 25 January 2017 (UTC)
Having just been through a break up recently (and the resulting sadness that eventuates) I identified with the "No, you deal with this" as a classic response to "If you have a problem with what I did, deal with it." 188.8.131.52 02:00, 26 January 2017 (UTC)
- Even without suffering a break up I came to the same connection and interpret the whole comic in that way. Tbh I don't see any connection to Trump's inauguration at all. But I'm not from the USA, and I understand the arguments leading to this conclusion. Yet I think it could be inserted as an alternative interpretation. Elektrizikekswerk (talk) 09:09, 26 January 2017 (UTC)
- For sure it is that which caused this. See my comment above, and the other Sad after Trumps election comic in the trivia. (And his I'm With Her comic). But a break-up also makes you sad, so if that is easier to relate to then this comic could also be for such a person. I do not live in the states but I'm sad because now we end up in a worse than current path scenario from the very bottom of the 1732: Earth Temperature Timeline comic. I would not be surprised if this election result will cause all ice to melt on Greenland very soon with devastating effect for Europe (because the Gulf stream may stop, so the "heat up" could case ice winters in Europe and cold summers) and many other places due to higher sea levels and wilder weather to boot. Sad? maybe, scared? for sure. We are not talking centuries, and maybe not even many decades the way things are going already and now Trump will make it worse by trying to stop scientist talking about their results and making oil lines through protected/fragile nature areas. ( Not to talk about the wall or women's rights etc. etc. etc.) --Kynde (talk) 14:56, 26 January 2017 (UTC)
- I recommend reading this http://waitbutwhy.com/2016/11/its-going-to-be-okay.html and this http://waitbutwhy.com/2016/11/its-going-to-be-okay-follow-up.html Those articles were written right after the vote, but they're still valid, I think. Yes, I agree with you that Trump might wreck havoc. But I object that he can do as much damage in (at most) 8 years as you worry about. He's no totalitarian dictator who can do whatever he wants (and if he can do, the US American system is seriously flawed. I know another democratic system which was seriously flawed and yes, the result was the worst catastrophe in the 20th century which indeed did influence the whole world in a very bad way). However, I don't want to argue about politics. And I don't want to say that the current explanation is wrong. I just want to say that there might be a (plausible) alternative interpretation. Elektrizikekswerk (talk) 08:40, 27 January 2017 (UTC)
- I entirely agree with Elektrizikekswerk. The election was bad, but it isn't the source of all sadness these days. There's no indication that this is about the election, so I don't understand why everyone is automatically accepting that as truth. HisHighestMinion (talk) 11:18, 27 January 2017 (UTC)
- Because this is the fourth since the election that is sad and is released in relation to events related to Trump - see Sad Comics section above. --Kynde (talk) 09:25, 28 January 2017 (UTC)
When people talk about virtual farms, I assume that they're talking about Farmville, so I was a little surprised for them to mention Stardew Valley instead. Oh well. I guess it's just me. (#waiting-for-the-nintendo-switch-port) --JayRulesXKCD what's up? 12:02, 27 January 2017 (UTC)
I vote we remove anything about Trump and speculation on Ponytail's depression other than the fact that she's obviously depressed and the initial correlation to Trump. i.e. lines 2 through 5 ("Of course, such sadness..." through "a clear relation to this comic!"). The comic doesn't dwell on it and it just seems like a ton of word cruft. 184.108.40.206 21:27, 28 January 2017 (UTC)
Why is like half of the explanation info about Trump? I came here to have XKCD explained, not the current political situation. I can go to other sites for that. If the Trump correlation is really that relevant, I think mentioning just once should be enough. 220.127.116.11 21:35, 31 January 2017 (UTC)
- I'm with this guy. I'm commenting out the four Trump paragraphs as a test, seeing as every fact has been repeated a second time in the much more relevant Trivia section. If it turns out we need it the admins can just delete the comment markers.18.104.22.168 18:59, 1 February 2017 (UTC)
I come on here to fix a few spell check errors, until I realize I accidentally left my Firefox extension on and any mention of Trump is replaced with "King Cheeto", even here in the explanations. xD --JayRulesXKCD what's up? 18:29, 10 February 2017 (UTC)
- Can someone please fix this? I don't think I can undo edits, but if a mod or something would please revert back to before all the "King Cheeto" stuff, that'd be greatly appreciated Viperzer0 (talk) 22:20, 23 August 2017 (UTC)