379: Forgetting

Explain xkcd: It's 'cause you're dumb.
(Difference between revisions)
Jump to: navigation, search
(Not bad, who says we don't love you?)
m (fix date according to http://www.xkcd.com/archive/)
Line 1: Line 1:
| number    = 379
| number    = 379
| date      = February 2, 2008
| date      = February 4, 2008
| title    = Forgetting
| title    = Forgetting
| image    = forgetting.png
| image    = forgetting.png

Revision as of 19:22, 23 February 2013

Of course, the assert doesn’t work.
Title text: Of course, the assert doesn’t work.


Cueball is writing a piece of code (probably in the programming language C++) which removes an item from a data structure called a Linked list (the first two lines of the text). Then, he writes a comment (which is delimited by the double slashes) relating the code to his personal life. Finally, he adds an assertion, which is normally a formal specification of a condition which should always be true (with which the programmer ensures that e.g. mass is not negative). But in this case, instead of asserting a software-related predicate, he asserts that “it’s going to be okay.”


[Cueball sits at computer, coding]
Text on computer: prev->next = toDelete->next;
delete toDelete;
// if only forgetting were
// this easy for me
Cueball at computer: <sniff>
[Man at computer lowers his head into his hands and cries]
[Cueball types again]
Text on computer: assert "It's going to be okay.";

comment.png add a comment! ⋅ Icons-mini-action refresh blue.gif refresh comments!


The syntax for pointers in C++ is &pointer and *pointer. The arrow syntax is used e.g. in PHP. So this explain does need a review. And furthermore it should focus on the assert joke, understandable for non programmers.--Dgbrt (talk) 18:48, 31 July 2013 (UTC)

Actually this works in C++ too. (*pointer).property is the same as pointer->property -- 17:58, 31 july 2013 (Time in Florida)
Do you have a code snippet, maybe this could help me to explain this comic for non programmers.--Dgbrt (talk) 22:43, 31 July 2013 (UTC)
At the moment I don't have a computer, just my phone, but I'll try (so i appologize for any typos in advance, you may correct them)

pair<int, int>* pntr = make_pair(5, 8); cout << (*pntr).first << endl; cout << pntr->first << endl; // the same as above -- 22:12, 31 July 2013 (Florida)

I removed PHP as a possible language since PHP variable names start with a $. Zetfr 09:24, 20 May 2015 (UTC)
Personal tools


It seems you are using noscript, which is stopping our project wonderful ads from working. Explain xkcd uses ads to pay for bandwidth, and we manually approve all our advertisers, and our ads are restricted to unobtrusive images and slow animated GIFs. If you found this site helpful, please consider whitelisting us.

Want to advertise with us, or donate to us with Paypal?