Editing 1695: Code Quality 2

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 8: Line 8:
  
 
==Explanation==
 
==Explanation==
This comic is the second in the [[:Category:Code Quality|Code Quality]] series:
+
{{incomplete|first edits}}
* [[1513: Code Quality]]
 
* [[1695: Code Quality 2]]
 
* [[1833: Code Quality 3]]
 
* [[1926: Bad Code]]
 
* [[2138: Wanna See the Code?]]
 
  
Although [[Cueball]] is not seen in this comic, we can surmise that he is speaking from off-panel based on continuity with [[1513: Code Quality]].
 
  
As in the first comic in the series, we again see [[Ponytail]] being introduced to the messy {{w|source code}} Cueball has written. This comic evidently takes place some time later, as Ponytail now appears to be familiar with Cueball's code, and dreads reading it.
 
  
In this comic she continues the trend started in the first comic by using a parade of vivid similes to convey the incomprehensible nature of Cueball's code.
 
  
===OCR, Scrabble, and Javascript-reserved words===
+
The comic is a continuation of [[1513: Code Quality]], in which we see [[Ponytail]] being introduced to the {{w|source code}} [[Cueball]] has written, and where he is warning her that he is self-taught so his code probably won't be written the way she is used to.
In her first simile, Ponytail makes a reference to using OCR ({{w|Optical Character Recognition}}) to recognize the letters on a {{w|Scrabble}} board. OCR is notoriously imperfect and often gets letters wrong, resulting in garbled words. The fact that a Scrabble board has criss-crossing words, with some of them traversing the board vertically, would make OCR output even less reliable.
+
She then continues to describe poetically the total mess of a code she encounters, using references to recipes created by corporate lawyers or the transcript of a couple arguing at IKEA.
  
Ponytail observes that Cueball’s code includes the [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords JavaScript reserved words] more often than a typical Scrabble board would, a concession that the code looks at least vaguely code-like. In programming, a reserved word is a word that has meaning to the programming language, and therefore is not permitted to be used as a variable name. Common examples are 'function', 'if', and 'return'. The reference to "triple points" refers to the fact that Scrabble's scoring system is based on the point values of individual letters; certain modifier squares on the board can double or triple those values. If Javascript reserved words are worth triple, that would incentivize the players to play them whenever they can, which could give the vague appearance of some kind of code structure.
+
The second panel makes a reference to "OCR" which is an acronym for [https://en.wikipedia.org/wiki/Optical_character_recognition Optical Character Recognition], a technique for recognizing text in a picture using software. In this case she is referring to a picture of a [https://en.wikipedia.org/wiki/Scrabble Scrabble] game, which is a popular word-making game in which players have a pseudo-randomized set of letters and must arrange them on a grid to form interlocking words. OCR software is notoriously imperfect at the time of writing, and the criss-crossing semi-random words on a Scrabble board fed through an OCR program would likely produce dubious results, certainly not fit for current code standards. This is further compounded by Ponytail's suggestion that Cueball made rampant use of JavaScript reserved words in his declarations, which is [http://www.javascripter.net/faq/reserved.htm strictly forbidden] by the language. Scrabble's point system is based on the value of individual letters, combined with certain modifier squares on the game board which can boost points. "Triple points" is the highest class of modifier available in the game (though it can be for triple points on a specific letter, or the entire word) and is highly-sought-after by players.
  
===Weather forecasts and woodpeckers===
+
The third panel continues Ponytail's rant, this time referencing naval weather forecasts, avian interference and indentation. A weather forecast is a complex, multidimensional array of data used in predicting or assessing the atmospheric conditions of a geographical area over a set time. One such example of a "naval weather forecast" [https://www.fnmoc.navy.mil/wxmap_cgi/cgi-bin/wxmap_DOD_area.cgi?area=efs_nvg_nlant&set=EFS may be this one], which would generally be unreadable to an untrained individual. Transcribing it would be a long and typing-intensive process which could result in an even more unreadable product, further complicated by a [https://en.wikipedia.org/wiki/Woodpecker woodpecker] (a bird noted for its rapid successive pecking motions) "hammering" (pecking) the Shift key on the keyboard, which would result in many letters being randomly capitalized. Indentation is the practice of shifting a section of text further from the starting margin, which in coding is typically used to organize functions and statements, but if done "randomly" would only serve to scramble the code hierarchy.
In her second simile, Ponytail references naval weather forecasts, avian interference, and indentation. A weather forecast is a complex, multidimensional array of data used in predicting or assessing the atmospheric conditions of a geographical area over a set time. [https://web.archive.org/web/20191115003453/https://aviationweather.gov/static/help/taf-decode.php Naval weather forecasts] (archive) use an extremely condensed code to send their information, rendering them unintelligible to an untrained reader. This is similar to the common bad coding practice of using unhelpful variable names - typically ones that are short and have no obvious meaning, or may even be misleading.
 
  
Transcribing such a weather forecast would be further complicated by a {{w|woodpecker}} randomly pecking the Shift key on the keyboard. Woodpeckers are wild birds famed for their ability to very rapidly peck at a target, which they use to make holes in trees, and also to create a loud "drumming" sound that can be heard a long way. Having a woodpecker peck at the Shift key would result in many letters being randomly capitalized, further reducing the readability of the output.
+
The fourth panel references famous poet [https://en.wikipedia.org/wiki/E._E._Cummings E. E. Cummings] and user name suggestions. E. E. Cummings was noted for his "unusual" style of poetry which combined words and phrases in ways that were a-typical for English speech, resulting in constructs that might easily confuse someone who doesn't natively speak the language. Websites that offer membership often also require that users create a pseudonym (known as a "username") for use in tracking/authenticating their actions on the site, as well as identifying them to the site's community. Many of these sites also require usernames be unique. On popular sites, many common words, phrases and names have already been reserved by users, so when signing up for them many people run into situations where the name they want has already been taken. On many sites where this happens, the site may suggest alternate usernames, usually based on the one that was entered to begin with. For example, if the username "Hedgeclipper" is already reserved, the site may recommend "Hedgeclipper1234" or "H3dg3clipp3r" instead, depending on the algorithm behind the suggestions. An E. E. Cummings poem written entirely out of these semi-random suggestions would make the resulting poem even more "unusual" than his work is already considered.
  
Ponytail then suggests that the output is "randomly indented". Indentation is the practice of shifting a section of text further from the starting margin. In coding, indentation typically has no semantic function, but rather is a way to visually indicate blocks of code in a hierarchical fashion. Without indentation, code becomes extremely hard to read - as an example, see the entries in the {{w|International Obfuscated C Code Contest}} to see just how bad this can get.
+
The last panel's metaphor involves [https://en.wikipedia.org/wiki/Markov_chain Markov chaining], [https://en.wikipedia.org/wiki/Chatterbot chat-bots] (presumably), bus schedules and potential gross vehicular negligence. Applied Markov chaining is a process used in many computer algorithms that try to simulate real-world concepts such as speech simulation and decisions-making. It's inherent randomness also makes it a candidate for unpredictable things such as stock market analysis and speech recognition. Bus schedules are [http://elb-jpinstances-1463028547.us-east-1.elb.amazonaws.com/ccg3/XSLT_STT_REQUEST?mode=direct&line=ccg:01065:%20:H:y15&sessionID=0&requestID=0&itdLPxx_template=tableResults&type_stt=any&language=en&coordOutputFormat=WGS84%5Bdd.ddddd%5D&outputFormat=0&name_stt=10111816&contentFilter=allstops often complicated and full of notation], and are notorious for confusing people who are not used to reading them. Chat-bots using applied Markov chains to recognize and respond to speech/text rely on the input being clear and well-organized in plain language. "Feeding" bus schedules to such a bot would likely result in the returns being complete gibberish and unreadable. The issue is further complicated when Ponytail suggests that the schedules are from a city where "the buses crash constantly", which would be horrifying if it happened so regularly that the schedules actually took crashes into account. Even more horrifying would be the further unpredictability of the output of the chat-bot from such unpredictable input.
  
The Python programming language is famous for actually making indentation part of its semantics - a Python program ''must'' be correctly indented, or it will not run.
+
Cueball finally comments that "...it runs fine for now" which indicates he knows the code has problems but it reluctant to fix them because it's more-or-less serving its function. Ponytail quips back that "So does a burning bus", which is technically true, but the "for now" part implies that disaster and injury could result at any moment, as would likely happen on a burning bus.
  
If a piece of code was ''randomly'' indented, this could be even worse than having no indentation at all, as it could lead readers to see structures where there are none.
+
==Transcript==
 
+
Side view of Ponytail sitting at a computer in all five panels.
===E. E. Cummings and usernames===
 
<div class="poem" style="float: right; clear: both; margin: 0 0.5em; font-size: 90%">
 
<pre class="poem preformatted">Buffalo Bill's
 
defunct
 
        who used to
 
        ride a watersmooth-silver
 
                                  stallion
 
and break onetwothreefourfive pigeonsjustlikethat
 
                                                  Jesus
 
he was a handsome man
 
                      and what i want to know is
 
how do you like your blueeyed boy
 
Mister Death</pre>
 
<div class="poem attribution" style="text-align: right">–E. E. Cummings, "Buffalo Bill's" (1920)</div>
 
</div>
 
Ponytail's third simile references famous poet {{w|E. E. Cummings}}. Edward Estlin Cummings was a poet who used capitalization, punctuation, and line breaks in unconventional ways, suggesting that Cueball's naming conventions are esoteric and hard to follow. She follows this up by restricting the vocabulary to "the usernames a website suggests when the one you want is taken". Websites that offer membership typically require users to create a username that uniquely identifies them. This means that two people cannot have the same username, so if you try to request a name that's already in use, the website will ask you to pick another. Some websites try to help out by suggesting alternative usernames which are close to, but not quite the same as, the one they requested.
 
 
 
For example, if the username "Hedgeclipper" is already taken, the site may recommend "Hedgeclipper1234" or "H3dg3clipp3r" instead, depending on the algorithm behind the suggestions. These names are usually harder to read and less elegant than the one the user actually wanted. An E. E. Cummings poem written entirely out of these semi-random suggestions would make the resulting poem even more "unusual" than his work is already considered.
 
 
 
===Markov bots and bus timetables===
 
The final simile involves {{w|Markov chain|Markov chaining}}, bus schedules, and potential gross vehicular negligence. A Markov chain is a sequence in which each symbol depends only on the previous symbol. This is often used to simulate real-world concepts such as speech simulation and decision making. For example, in English text, you can make reasonable predictions as to what the next letter might be, based on the knowledge of which letters tend to be used together (and which don't). Thus, a Markov bot programmed with basic knowledge of English letter frequencies could produce plausible-looking text. However, the text would make absolutely no sense, as Markov processes are probabalistic and have no knowledge of how English semantics work.
 
  
Bus schedules are [http://elb-jpinstances-1463028547.us-east-1.elb.amazonaws.com/ccg3/XSLT_STT_REQUEST?mode=direct&line=ccg:01065:%20:H:y15&sessionID=0&requestID=0&itdLPxx_template=tableResults&type_stt=any&language=en&coordOutputFormat=WGS84%5Bdd.ddddd%5D&outputFormat=0&name_stt=10111816&contentFilter=allstops often complicated and full of notation], and are notorious for confusing people who are not used to reading them. Using these as the input to a Markov bot would result in an even more garbled and unreadable mess, as the Markov bot doesn't understand bus timetables either.
+
First panel, tall vertical.<br>
 +
Ponytail: Ugh, I hate reading your code.<br>
 +
Offscreen: I know, I know.
  
The issue is further complicated when Ponytail suggests that the schedules are from a city where "the buses crash constantly", which would be horrifying if it happened so regularly that the schedules actually took crashes into account. However, this is likely just Ponytail adding an additional layer of convolution to the simile.
+
Second panel is wider, shows her in an office chair.<br>
 +
Ponytail: It's like you ran OCR on a photo of a Scrabble board from a game where Javascript reserved words counted for triple points.<br>
  
Cueball finally comments that "… it runs fine for now" which indicates he knows the code has problems but is reluctant to fix them because it's more-or-less serving its function. This is a well-known cop-out in software development, and is considered poor practice - the fact that the code is running ''for now'', or runs in the specific circumstances the developer tested it in, does not mean that it is well-written, or that it will integrate with other parts of the system, or that it will continue to run reliably in the future.
+
Third panel zooms in and shows just her head.<br>
 +
Ponytail: It looks like someone transcribed a naval weather forecast while woodpeckers hammered their shift keys, then randomly indented it.<br>
  
Ponytail quips back that "So does a burning bus", which also meets Cueball's low standard - a burning bus can still drive despite being on fire, but most people would not enjoy traveling in such a vehicle,{{Citation needed}} and there will eventually come a point where the fire will endanger the occupants and interfere with the operation of the bus. This could be the reason the buses are always crashing in Ponytail's hypothetical scenario.
+
Fourth panel, similar to second, though slightly narrower.<br>
 +
Ponytail: It's like an e e cummings poem written using only the usernames a website suggests when the one you want is taken.<br>
  
===Title text===
+
Fifth panel zooms in, shows her head and the screen.<br>
In the title text, Ponytail compares the code to a formal grammar, which is a way of describing a set of strings by providing a list of mapping rules that generate those strings. The resulting output would be a laborious list of rules which would all randomly reference each other, akin to {{w|spaghetti code}}. Furthermore, she suggests that the grammar is based on fragments of a raw {{w|database dump}}, which would be an export of the data from a database in a "raw" format that contains no processing to make it easy for humans to read. {{w|QuickBooks}} is an accounting software package, which could imply that the code Cueball has written is related to finance in some way. If the company using QuickBooks is embroiled in an accounting scandal, their database is likely already in a mess, even in human-readable format.
+
Ponytail: This looks like the output of a Markov bot that's been fed bus timetables from a city where the buses crash constantly.<br>
 
+
Offscreen: Whatever, it runs fine for now.<br>
==Transcript==
+
Ponytail: So does a burning bus.
:[Zoom in on Ponytail sitting in front of a computer screen typing. Cueball speaks only off-panel, but since this is a direct continuation of comic 1513: Code Quality where Cueball is shown, there can be no doubt it is him.]
 
:Ponytail: Ugh, I hate reading your code.
 
:Cueball (off-panel): I know, I know.
 
 
 
:[Zoom out of Ponytail in an office chair in front of the computer on a desk.]
 
:Ponytail: It's like you ran OCR on a photo of a Scrabble board from a game where Javascript reserved words counted for triple points.
 
 
 
:[Zoom in on Ponytails head.]
 
:Ponytail: It looks like someone transcribed a naval weather forecast while woodpeckers hammered their shift keys, then randomly indented it.
 
 
 
:[Zoom out back to the setting of the second panel.]
 
:Ponytail: It's like an E E Cummings poem written using only the usernames a website suggests when the one you want is taken.
 
 
 
:[Zoom in to Ponytails head and the screen in a wider panel. Finally Cueball again answers off-panel.]
 
:Ponytail: This looks like the output of a Markov bot that's been fed bus timetables from a city where the buses crash constantly.
 
:Cueball (off-panel): Whatever, it runs fine for now.
 
:Ponytail: So does a burning bus.
 
  
 
{{comic discussion}}
 
{{comic discussion}}
 
[[Category:Code Quality]]
 
[[Category:Comics sharing name|Code Quality 02]]
 
[[Category:Comics featuring Ponytail]]
 
[[Category:Comics featuring Cueball]] <!--It is Cueball that replies given that this is a follow up to 1513: Code Quality -->
 
[[Category:Language]] <!-- Formal grammar title text-->
 
[[Category:Animals]]  <!-- Woodpeckers -->
 
[[Category:Programming]]
 
[[Category:Computers]]
 
[[Category:Cueball Computer Problems]]
 

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)