Difference between revisions of "379: Forgetting"
(Created page with "{{comic | number = 379 | date = February 2, 2008 | title = Forgetting | image = forgetting.png | titletext = Of course, the assert doesn’t work. }} ==Explan...") |
(Not bad, who says we don't love you?) |
||
Line 8: | Line 8: | ||
==Explanation== | ==Explanation== | ||
− | [[Cueball]] is writing a piece of code (probably in the programming language | + | [[Cueball]] is writing a piece of code (probably in the programming language {{w|C++}}) which removes an item from a data structure called a {{w|Linked list}} (the first two lines of the text). Then, he writes a {{w|Comment (computer programming)|comment}} (which is delimited by the double slashes) relating the code to his personal life. Finally, he adds an {{w|Assertion (computing)|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.” |
==Transcript== | ==Transcript== | ||
− | :[ | + | :[Cueball sits at computer, coding] |
:Text on computer: prev->next = toDelete->next; | :Text on computer: prev->next = toDelete->next; | ||
:delete toDelete; | :delete toDelete; | ||
− | |||
:// if only forgetting were | :// if only forgetting were | ||
:// this easy for me | :// this easy for me | ||
− | : | + | :Cueball at computer: <sniff> |
:[Man at computer lowers his head into his hands and cries] | :[Man at computer lowers his head into his hands and cries] | ||
− | :[ | + | :[Cueball types again] |
− | : Text on computer: assert "It's going to be okay."; | + | :Text on computer: assert "It's going to be okay."; |
− | |||
− | |||
− | |||
+ | {{comic discussion}} | ||
[[Category:Comics featuring Cueball]] | [[Category:Comics featuring Cueball]] | ||
[[Category:Programming]] | [[Category:Programming]] |
Revision as of 11:02, 18 January 2013
Forgetting |
Title text: Of course, the assert doesn’t work. |
Explanation
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.”
Transcript
- [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.";
Discussion
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)
pair<int, int>* pntr = make_pair(5, 8); cout << (*pntr).first << endl; cout << pntr->first << endl; // the same as above
- The arrow operator -> is a valid way to access object members using smart ptrs in C++
-- 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)
- IT IS A COMBINACION EN C++/ANOTHER LENGUAGE IN THE FOURTH PANEL ASSERT HAS NOT PARENTHESES. IN C++ THE ASSERT MUST HAVE THE PARENTHESES AND SO CANNOT BE A C++ PROGRAM. PLEASE ADVISE 108.162.210.219 (talk) (please sign your comments with ~~~~)
man this one made me cry...
if i could at least forget what happened to sally... i wish it was as easy as "del filename".
this one, sadly, is too relatable for me. An user who has no account yet (talk) 15:56, 5 September 2023 (UTC)