✕
Proofreading requested
English, Other
English, Other
dot of steel dot hello world (semicolon)
public class hello world
main launcher class (open braces)3
public hello world main launcher class
round brackets int foo (open brackets)
super round bracket4
this dot foo equals foo (semicolon close brackets)
private integer foo equals zero (semicolon)
public void song refrain, round brackets (open brackets)
for int i equals zero
i less than foo i plus plus
(system out dot print el en)
(hello world, semicolon)5
pippo plus plus
(double close brackets)
public static void main
string square brackets are gee es7 (open brackets)
system out dot print el en
hello world programmer start (semicolon)
hello world main launcher class tizio equals8
new hello world main launcher class two (semicolon)
tizio dot song refrain open close round brackets (semicolon)
system out dot print el en
program finished (semicolon close bracket)9
for int i equals zero
i less than foo i plus plus
(system out dot print el en)
(hello world, semicolon)
int pippo equals zero
while pippo less than foo
(system out dot print el en)
(hello world)
If I may introduce a bug,
the JVM will manage it for me,
ensuring both security and portability.
Then I’ll write my code once,
and run it everywhere!10
With static and strong typing,
will let my programs be type safe!11
Garbage collector!12
for int i equals zero
i less than foo i plus plus
(system out dot print el en)
(hello world, semicolon)
{public void false method}
int pippo equals zero
while pippo less than foo
(system out dot print el en)
{boolean metal equals false}
(hello world)
{if metal double equals false}
for int i equals zero
i less than foo i plus plus
{???}
(system out dot print el en)
(hello world, semicolon)
{string Joey DeCaio equals null}13
int pippo equals zero
while pippo less than foo
{Joey DeCaio}14
(system out dot print el en)
(hello w—)
{Yoow! Null pointer exception!}15
- 1. It is not a coincidence that the song vocals take almost 30 seconds to start, just like (most) IDEs take a frustratingly long time to start up.
- 2. This “dot” shouldn’t really be there. Fortunately, the source code in their repository was (seemingly) not produced by an audio transcription AI, so it’s free from such trivial syntactical mistakes.
- 3. They are singing (erm, coding) in the Eclipse IDE, and they use the “automatically insert braces” feature, so that a matching closing brace/bracket is immediately inserted (sung) as soon as the opening one is, instead of adding it at the end. However, they will sometimes explicitly spell out the closing brackets.
- 4. They have another bug here: they forget to sing the semicolon, though it somehow magically appears in the videoclip, though Java is not Javascript (no, it’s not, though the name similarity is not a coincidence).
Further “silent character” bugs are found elsewhere, especially for dots and opening brackets. - 5. They should burn in hell (the videoclip suggests as much) for using a font which such a glyph for the semicolon, which is totally indistinguishable from a colon, unless you zoom in so much that you would need a 16-char line width limit. And also for using a non-monospace font.
- 6. “pippo” (literally “Goofy”, as in the Disney character) is the Italian equivalent of foo, with “pluto” (again, as the Disney character) being the equivalent of bar.
See here.
Such names even make it into production, for instance on the website of INPS, the Italian public retirement agency (see here) - 7. This is supposed to spell out the variable name args (for “(command line) arguments”).
- 8. “tizio” is another – quite rare – foo/bar/foobar equivalent, and it’s part of the “Tizio, Caio e Sempronio” triad {Tom, Dick and Harry}.
- 9. Here, the song misses the all-important call to tizio.falseMethod(), without which the NullPointerException can’t be triggered below. See the source code.
- 10. Some programming languages work in such a way that the source code is translated into code that is specific to some computer architecture (and operating system), so that it will not run on a different one (a different version is needed, which the programmer must specifically generate).
Others work in a way that the source code itself is interpreted by the system, so that any system can run the program, without the need for a different version. Java is on a middle ground, since it is translated (“compiled”) to an intermediate representation, which is identical for all systems, and which is then interpreted by a JVM (Java Virtual Machine). Different systems have different virtual machines, which handle the differences in the underlying system, hiding it from the program itself, which is run the same regardless of the differences in the system. That’s why it is a “virtual” machine – it provides a virtual environment for the program to execute in, which is the same everywhere, despite the underlying system (hardware and OS) being potentially very different. This fact was a major selling point in the early history of the Java language, with the slogan “write once, run everywhere”, implying that the same exact source-code program would work on every system (for which a JVM exists), thus removing a consistent part of the workload from the programmer, who doesn’t need to explicitly handle the incompatibilities between different systems. This ability to run an identical program on different system is called portability.
Security is the property of a program to resist malicious attacks aimed at discovering personal or secret data, such as passwords, or to otherwise gain access privileges that the malicious user is not supposed to have. The JVM partially “insulates” the program from the underlying system, making certain attacks more difficult, thus guaranteeing a certain level of security, that a programmer would have to achieve by themselves if the JVM wasn’t there. - 11. In a programming language, there are variables, which are like “boxes” that can contain a value, which can be manipulated by the program (for instance, by performing math operations on it, or making decisions based on it). Each value has a specific type (for instance, a number, or a piece of text). Strongly-typed languages force the programmer to be explicit about which types of values can be stored in each variable, which creates more work for the programmer, but also helps a great deal in avoiding bugs (due to mishandling or misinterpreting some values).
Type-safe indicates a language that enforces enough constraints that the programmer cannot misinterpret the types in any way, thus making the program less bug-prone (though it can still contain various other types of bugs, not related to types).
Static typing refers to the fact that types are enforced by the system when the program is written; that is, the type of a variable cannot change dynamically as the program is executing. This makes for less flexible but also less bug-prone programs. - 12. Each program needs to reserve some memory to store all the values of its variables. Some languages require the programmer to explicitly handle the allocation and deallocation of memory (ie the reservation of memory when needed, and its release to the system when it’s no longer needed). This allows for very flexible and efficient programs, but is also a major source of bugs, including very dangerous security-related bugs. For this reason, some languages (including Java) offer the “garbage collection” feature: when some piece of memory is no longer needed, the program can just “throw it out” (ie. forget about it), and the system will automatically detect that it’s no longer in use, and “collect” it for later reuse. The software component that performs this collection is called a “garbage collector”.
- 13. “Joey DeCaio” is a reference to Joey DeMaio, bass player and songwriter for the heavy metal band Manowar. The band’s name is also parodied in the name Nanowar of Steel (see here): the Italian band was initially called simply Nanowar, from Manowar, and then of Steel was added, just like the Italian heavy metal band Rhapsody had changed their name to Rhapsody of Fire due to a legal dispute.
- 14. Another misstep, since just mentioning Joey DeCaio is not enough to trigger the exception (it would actually cause a compile-time “not a statement” error). Its dereferencing (eg. by calling the function length() on it) is needed, just like in the source code.
- 15. In some programming languages, a pointer is a variable that refers to some memory location (where other values are). The special value null indicates that this reference is invalid, so that the program may not go there and try to fetch that value (for instance, that memory might not even exist in the system). If a program has a bug, and tries to go fetch the value referred-to by the null pointer, errors will occur. In the case of the Java language, the system will raise a NullPointerException, ie. it will signal to the program that the operation was forbidden. The program may then try to take some corrective action, but since this is something that is not supposed to happen (it was a bug, a mistake in the programming, not a legitimate error condition to be handled explicitly), the program will most probably do nothing at all – as is the case in this hello world program – so the system will just terminate it abruptly, to avoid more serious damage (the program will “crash”).
In the song, the variable joeyDeCaio was set to null and then was accessed, triggering the NullPointerException. This causes the program to terminate abruptly, even though it was still in the middle of its execution – it was still printing “Hello World”, which is left unfinished due to the crash.
Note that when the program triggers the exception, the printing triggered by the two preceding lines are still being performed, since the standard output is buffered, and actual printing on the screen happens asynchronously, when the program has already moved on with its execution.
Comments
The song is written as a software application written in the Java programming language.
The source code for such a program is stored in files with the .java extension, as in the title.
A “Hello World” program is a simple program that does nothing useful, and is only used to teach complete beginners or to test that the whole development environment is set up properly, before starting writing the actual program.
***
Since the song is made of Java source code, with quite a lot of meaningful syntactic punctuation, here is how they actually pronounce it, including missing punctuation, and repeated parts in the refrain (which would not be repeated in the actual source code). Though transcribed in English, the code is sung with a distinct (though quite mild) Italian accent, probably on purpose (see “hello” /ˈhɛllo/, “launcher” /ˈlaunʧer/, “Integer” /ˈinteɡəɹ/).
***
See also the github repository (direct link to the file that is read out by the song).