Difference between revisions of "754: Dependencies"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(Explanation)
m (Transcript: Space)
(26 intermediate revisions by 15 users not shown)
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 particular programming language, into an executable program. A section of code is said to be dependent on a second segment of code if the results of the first segment are potentially impacted by the second segment. 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.
  
{{incomplete|this explain is still a horror for non programmers.}}
+
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
+
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.
:A {{w|compiler}} is a computer program that translates a program written in one computer language -- C++, for example -- into an equivalent program written in another language, say x86 machine code, or JavaScript, or C. See also [[303: Compiling]].  
 
  
:Modern compilers typically not only translate one language into another, but in the process verify that the input program is a legal example of the programming language in question; a C++ to C compiler should not take an illegal C++ program and produce an illegal C program; rather, it should inform the user that the input was incorrect. One of the ways in which programs are determines to be incorrect is through an analysis of how the different parts of the program depend on each other.
+
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.  
  
:For example, one portion of a program might be responsible for representing a person. Another portion of the program might be responsible for representing the fact "employees are a kind of person", and yet another might be responsible for "managers are a kind of employee". The compiler could reason that the employee code depends directly on the person code. It could also reason that the manager code depends directly on the employee code. It could then conclude logically that the manager code depends indirectly on the person code.
+
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:
 +
*Requiring that the course be a prerequisite to itself (CPSC 357).
 +
*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.
 +
*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.
  
:Many programming languages require that these sorts of dependencies be free of cycles. It would be an error in many programming languages to say, for instance, that a manager is a kind of employee, an employee is a kind of person, and a person is a kind of manager, because a diagram of the dependencies would contain a loop. A developer who is writing a compiler must therefore understand first how to identify dependencies in a program, and second, how to determine whether a particular set of dependencies is legal or illegal.
+
==Transcript==
 
+
:[A portion of a page from an imaginary course catalog.]
:There are numerous other problems in compiler construction which require understanding dependencies. For example, suppose a program must make two lengthy computations, call them X and Y, and then sum the result. Clearly the final sum X + Y cannot be computed until both X and Y are computed; the sum depends on X and Y. If the computation to produce Y does not depend on the result of computation X, then Y can be computed before X. If the computation to produce X also does not depend on the result of Y, then X may be computed before Y. If both X and Y are independent of each other then the compiler is free to choose whichever ordering it believes to be most efficient. By analyzing dependencies between different computations the compiler can ensure that the translated form of the program is both correct and efficient.
+
:Page 3
 
 
:Solving dependency management problems is also necessary in many areas of programming other than compiler design, such as package management, discussed below.
 
  
: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.
+
:[A table with four columns]
  
:The comic envisions a college computer science course (CPSC432) focusing on dependency resolution which has itself as a prerequisite. That is, you must complete this course before you can enroll in it, which is clearly impossible. This is analogous to the sort of problem that the dependency analyzer in a modern compiler must notice and inform the user about. Ironically, the cyclic dependency here is the easiest one to spot: the cycle where a thing depends directly on itself.
+
:;Department
 +
::Computer Science
  
;Title Text
+
:;Course
:{{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". For example, a software package might require that a particular operating system security patch be already installed. That patch might in turn require other packages be installed, and so on. The installer must know its dependencies, and figure out whether any of its dependencies are missing before continuing with the installation.
+
::CPSC 432
  
:The title text posits a course on package management which is dependent not only on itself (a cyclic dependency), but also on the course presented in the main comic, which has a higher course number. A dependency from a lower-numbered package to a higher-numbered package is typically disallowed because it can create cycles.
+
:;Description
 +
::Intermediate compiler design, with a focus on dependency resolution.
  
: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.
+
:;Prereqs
 +
::CPSC 432
  
==Transcript==
+
:[The very top of the text for the next course in the table is visible but unreadable.]
:A portion of a page from an imaginary course catalog.
 
  
:Page 3
+
==Trivia==
:[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".]
+
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]]

Revision as of 16:09, 13 October 2018

Dependencies
The prereqs for CPSC 357, the class on package management, are CPSC 432, CPSC 357, and glibc2.5 or later.
Title text: The prereqs for CPSC 357, the class on package management, are CPSC 432, CPSC 357, and glibc2.5 or later.

Explanation

A compiler is a program that converts code, written in a particular programming language, into an executable program. A section of code is said to be dependent on a second segment of code if the results of the first segment are potentially impacted by the second segment. 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 Catch-22.

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.

Managing dependencies is useful in other areas of computer science, e.g. 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 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:

  • Requiring that the course be a prerequisite to itself (CPSC 357).
  • 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.
  • 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

[A portion of a page from an imaginary course catalog.]
Page 3
[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.


comment.png add a comment! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!

Discussion

Concurrent enrollment FTW 75.60.27.102 03:11, 29 March 2013 (UTC)

I'm a programmer so I'm ok with the explanation, but it seems too technical for non programmers. 108.162.212.196 02:22, 12 January 2014 (UTC)

In response to the programmer at 108.162.212.196: yes, it's probably too technical for non-programmers. But then again, so is the comic. It's a programming (or logic) joke. Unfortunately the level of knowledge required to 'get' some of Randall's humour can't always be reduced down to a simplistic lowest common denominator. 141.101.81.216 06:36, 24 February 2014 (UTC)

"Yes, Microsoft CRT 9.0 or later is acceptable. But you should probably think about getting MinGW, Cygwin, or just switch to Linux." (groan) 108.162.221.9 01:00, 17 April 2014 (UTC)

CPSC 432 lists itself as a prereq, not a coreq. A coreq can be satisfied by enrolling in the original course and the coreq course at the same time; however, prior completion of the course is required in the case of a prereq. So the dependency problem here cannot be solved by allowing a course to satisfy itself, and as a result, no one will be able to enroll in this course. The joke here is thus that the instructor of a course on dependency resolution created a dependency problem himself. --Troy0 (talk) 07:04, 17 August 2014 (UTC)

Added to the talk as it was removed from the main content:

Alternately, the title text could be a meta joke where course prerequisites are confused with system requirements. System requirements tell the user what other hardware or software are requied in order for a piece of software to run properly, such as a minimum amount of RAM or a particular operating system. The inclusion of glibc2.5 in the prerequisites might mean that the student needs to have this package loaded rather than be familiar with it. --Smperron (talk)
This does not fit with the context of the joke (which is about dependencies) also clearly all other items in the title text are dependency related, therefore this is very unlikely. However the current description may be incorrect and the glibc2.5 or later comment may just be the author intentionally confusing prerequisite and package management dependencies. 108.162.216.209 20:32, 5 December 2014 (UTC)

About the third/fourth year things: I don't know how it works at all U.S. schools, but at mine just because a class starts with a 3 or a 4 doesn't mean it HAS to be taken in that year. Because of the way the pre-reqs (for my major, at my school) work, I can take a 2000-level class, then a 3000-level, then a 4000 and some more 3000s... so a "fourth year" class can be taken before a "third year", just in general. 173.245.56.71 12:46, 1 July 2016 (UTC)

I was trying to read the next course, and here's what I saw: "Computer" | CPSC 433 | Advanced compiler design | DHTL 101