Editing 754: Dependencies

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 3: Line 3:
 
| date      = June 16, 2010
 
| date      = June 16, 2010
 
| title    = Dependencies
 
| title    = Dependencies
| image    = dependencies.png
+
| image    = Dependencies.png
 
| titletext = The prereqs for CPSC 357, the class on package management, are CPSC 432, CPSC 357, and glibc2.5 or later.
 
| titletext = The prereqs for CPSC 357, the class on package management, are CPSC 432, CPSC 357, and glibc2.5 or later.
 
}}
 
}}
  
 
==Explanation==
 
==Explanation==
A compiler is a program that converts code written in a high-level programming language into an executable program. A section of code is said to be dependent on a second segment of code if the second segment is required for the first segment to work. Dependency resolution is part of compiler design, and is the study of determining and correcting dependencies which result in an unwanted, ambiguous, or impossible definition of the dependent section. Requiring that an action occurs if and only if the action has already occurred, like the prerequisite in this comic, is one type of potentially unwanted dependency.
 
  
The comic envisions a college computer science course (CPSC432) focusing on "compiler design with dependency resolution" which has itself as a prerequisite. The joke is that the prerequisite is an unresolved dependency, as you must complete this course before you can enroll in it, a phenomenon called {{w|Catch-22 (logic)|Catch-22}}.
+
; Comic
 +
{{incomplete|this explain is still a horror for non programmers.}}
 +
One of the responsibilities of a {{w|compiler}} (a program that converts computer code to something the computer can actually read, as per [[303: Compiling]]) is {{w|Topological sorting|dependency resolution}}, the process of identifying what other components are necessary in order to construct a target component. Those other components may in turn may have their own requirements, all of which must also be satisfied.
  
This dependency would send a poorly designed compiler into an infinite loop. In real life, the problem is solved by allowing an object to satisfy itself as a prerequisite. This stops the compiler's infinite loop, but may not produce the desired functionality in the program. Another layer of the joke may be that any student who successfully enrolls in the class already knows this solution because they must have employed it in order to get past the apparent infinite recursion in the class prerequisites.
+
On college campuses, course names indicate the department and level of a course. CPSC would be one way to express Computer Science classes, and course numbers in the 400 range would likely indicate a senior-level course.
  
Managing dependencies is useful in other areas of computer science, e.g. {{w|package management}}. Collections of files are known as "packages". A software package might require that a particular operating system patch (a type of package) be installed first. That package might in turn require other packages be installed, and so on. Therefore, a package installer must know the dependencies of a package, and be able to figure out whether any required packages are missing before continuing with the installation.  
+
The comic envisions a college computer science course (CPSC432) focusing on dependency resolution which has itself as a prerequisite (i.e. you must complete this course before you can enroll in it). This dependency structure would send a naïve compiler into an infinite loop. In real life, the problem is solved by allowing an object to satisfy itself as a prerequisite. You see this, for example, every time you compile a {{w|recursive_function|recursive function}}. The joke is that any student who successfully enrolls in the class already knows this solution because they must have employed it in order to get past the apparent infinite recursion in the class prerequisites.
  
The title text envisions a course on package management which has itself as a prerequisite, as well as the compiler design course with the impossible prerequisite presented in the main comic (CPSC 432), and glibc2.5 or greater. By looking at the course number it can be observed that CPSC 432 is a fourth year course, and this package management course (CPSC 357) is a third year course. Glibc is a commonly used package on Unix systems, and therefore should be taught in the course. This continues the joke since this course has the following unresolved dependencies:
+
;Title Text
*Requiring that the course be a prerequisite to itself (CPSC 357).
+
{{w|Package management}} is a problem in software deployment similar to compiler dependency resolution, except that the dependencies are collections of files known as "packages".
*Requiring that a course with an unresolved dependency (CPSC 432) be a prerequisite, as CPSC 432 can not be taken.
+
 
*Requiring that a fourth year course (CPSC 432) be a prerequisite to a third year course (CPSC 357), as the student should be in their fourth year while taking CPSC 432, and should be in their third year while taking CPSC 357. This is analogous to a lower-numbered package requiring a higher-numbered package.
+
The title text posits a course on package management which is dependent not only on itself (recursive dependency), but also on the course presented in the main comic, which has a higher course number. Package managers resolve self-dependencies in much the same way as compilers do, but a dependency from a lower-numbered package to a higher-numbered package is typically disallowed because it can create cycles in what is supposed to be a tree structure. glibc is a commonly-used package on Unix systems. Its inclusion as a course prerequisite blurs the line between the course material and the course itself.
*Requiring that the student knows part or all of the course material (glibc2.5 or greater) before taking the course, as the student is supposed to learn this information from the course.
 
  
 
==Transcript==
 
==Transcript==
:[A portion of a page from an imaginary course catalog.]
+
:A portion of a page from an imaginary course catalog.
 +
 
 
:Page 3
 
:Page 3
 
+
:[A table with four columns labeled Department, Course, Description, and Prereqs. Under 'Department' it reads, "computer science". Under 'course' it reads, "CPSC 432". Under 'Description' it reads, "Intermediate compiler design, with a focus on dependency resolution." Under 'Prereqs' it reads, "CPSC 432".]
:[A table with four columns]
 
 
 
:;Department
 
::Computer Science
 
 
 
:;Course
 
::CPSC 432
 
 
 
:;Description
 
::Intermediate compiler design, with a focus on dependency resolution.
 
 
 
:;Prereqs
 
::CPSC 432
 
 
 
:[The very top of the text for the next course in the table is visible but unreadable.]
 
 
 
==Trivia==
 
The letter code "CPSC" is the letter code Christopher Newport University, [[Randall]]'s alma mater, uses for Computer Science.
 
  
 
{{comic discussion}}
 
{{comic discussion}}
 
[[Category:Programming]]
 
[[Category:Programming]]
 
[[Category:Recursion]]
 
[[Category:Recursion]]

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)