Main Page

Explain xkcd: It's 'cause you're dumb.
Revision as of 18:20, 22 November 2012 by Waldir (Talk | contribs)

Jump to: navigation, search


Welcome to the explain xkcd wiki! We already have Expression error: Unrecognised punctuation character ",". comic explanations!

(But there are still Expression error: Unrecognised punctuation character ",". to go. Come and add yours!)

Latest comic

Go to this comic

Code Quality
I honestly didn't think you could even USE emoji in variable names. Or that there were so many different crying ones.
Title text: I honestly didn't think you could even USE emoji in variable names. Or that there were so many different crying ones.

Explanation

Ponytail is about to look at some source code Cueball has written, and he is warning her that he is self-taught so his code probably won't be written the way she is used to.

In spite of Ponytail's initial (polite) optimism, she comments in three increasingly harsh similes. First, she suggests that reading his code is like being in a house built by a child, using a small axe to put together what he thought was a house based on a picture. This relates to a technique especially common for new programmers. They follow and adapt tutorials, and find examples of similar problems being solved, copy the solution ("cutting" it out as with an axe), jury-rig it together, and tinker with it until it seems to work. This can lead to code that is hard to follow or otherwise "messy" and inconsistent. Once a piece of code is working, inexperienced or deadline-driven coders are reluctant to go back and rewrite it to be cleaner or clearer, for fear of breaking something that has been working. More experienced coders will go back after the first time the code worked and try to improve the code if they think it is possible. This improvement practice is known as refactoring and code projects that incorporate cycles of refactoring tend to be easier to read and maintain than those that don't. Including good test cases reduces the risks.

Second, she suggests that it looks like a salad recipe, written by a corporate lawyer on a phone with autocorrect that only corrected things to formulas from Microsoft Excel. This presumably relates to the way many programmers use integrated development environments (IDEs). They serve as syntax-checkers and often also help correct other programming errors, but their corrections and advice can be unnatural and difficult to understand (like corporate lawyers producing Excel formulas). The result of just fixing what the IDE complains about often results in less-than-elegant code.

Third, she describes it as a transcript of the dialog of couple arguing at IKEA, which was then randomly edited until the computer compiled it with no errors. IKEA is a world-wide chain of furniture stores which feature large, maze-like showrooms as well as a large warehouse area where you can pick up the furniture you want to buy in flat, some-assembly-required packaging. Especially on weekends when many people crowd in to a store, they can be stress-inducing places. So coming across arguing couples in IKEA is to be expected. Software development often starts with a set of requirements which result from discussions (or arguments) between the stakeholders: architects, requirements analysts, designers, customers, management, programmers and others. It is common for these requirements to end up confusing and contradictory, suffering from a tendency to include some parts of everyone's requests.

Finally, Cueball makes the rather weak assurance that he will read “a style guide”. Although few programming languages require a perfectly rigid style, so long as the code is syntactically accurate, most programmers follow some sort of style to make the code easier to read. This includes indenting lines to show levels and using descriptive variable identifiers with CamelCase (or camelCase) or snake_case capitalization (capitalizing each word except for the first, and separating lowercase words with underscores, respectively).

It seems clear from Ponytail's commentary that his code quality would benefit from far more training in computer programming.

The title text refers to emoji, originally called "smiley faces". Ponytail's comment implies that some of Cueball's variables contained emoji, perhaps in an effort to capture the emotional content of the arguments which show thru the requirements document. Emoji can be simulated using ASCII characters, and have roots in ASCII emoticons. Most languages will allow variable names to include underscores, so some sad face ASCII emoji will be legal variable names, such as T_T, p_q, ioi etc., but such things rarely show up in software variables.

Progressively more crying-face emoji are possible if variables can include UTF-8 characters or full Unicode, e.g. 😢,😭,😂,😿,😹. In most programming languages it would be impossible to use them in variable names, as the symbols would break the language's syntax rules. Notable exceptions to this are Go and Swift, Apple's new programming language, in which the code can understand and use emojis in variables. Java, as another example, allows unicode characters in variable names as long as they are letter, numeric, combining or non-formatting marks. (See [1] and [2]). Also, some C++ compilers support foreign Unicode characters and can have emoji in that manner.

Transcript

[Cueball showing Ponytail his laptop.]
Cueball: Keep in mind that I'm self-taught, so my code may be a little messy.
Ponytail: Lemme see - I'm sure it's fine.
[Ponytail sits at desk, Cueball stand behind her.]
Ponytail: ...Wow. This is like being in a house built by a child using nothing but a hatchet and a picture of a house.
[Ponytail sits at desk, Cueball stand behind her.]
Ponytail: It's like a salad recipe written by a corporate lawyer using a phone autocorrect that only knew Excel formulas.
[Ponytail sits at desk, Cueball stand behind her.]
Ponytail: It's like someone took a transcript of a couple arguing at IKEA and made random edits until it compiled without errors.
Cueball: Okay, I'll read a style guide.

New here?

Feel free to sign up for an account and contribute to the explain xkcd wiki! We need explanations for comics, characters, themes, memes and everything in between. If it is referenced in an xkcd web comic, it should be here.

  • List of all comics contains a complete table of all xkcd comics so far and the corresponding explanations. The red links (like this) are missing explanations. Feel free to help out by creating them!

Rules

Don't be a jerk. There are a lot of comics that don't have set in stone explanations, feel free to put multiple interpretations in the wiki page for each comic.

If you want to talk about a specific comic, use its discussion page.

Please only submit material directly related to—and helping everyone better understand—xkcd... and of course only submit material that can legally be posted (and freely edited.) Off-topic or other inappropriate content is subject to removal or modification at admin discretion, and users posting such are at risk of being blocked.

If you need assistance from an admin, feel free to leave a message on their personal discussion page. The list of admins is here.

Explain xkcd logo courtesy of User:Alek2407.

Personal tools
Namespaces

Variants
Actions
Navigation
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 or Bitcoin?