Term of the Day

The Sinclair ZX Spectrum was a considerably popular personal computer during the 1980s. Developed in Britain, it is often credited for popularizing use of the personal computer in Europe. It featured a screen resolution of 256 by 192 colored pixels (unprecedented at the time for a household computer). It was also known for its multifunction rubber...
Read more

IT Business

Quine

Definition - What does Quine mean?

A quine is a program that essentially outputs its own source code. Although this sounds simple, it can be quite complex because of the necessity of engineering a string that essentially prints itself on command.

Quines are also known as self-replicating programs or self-copying programs.

Techopedia explains Quine

In order to create a quine, it is necessary to create some sort of string reference that cleanly prints the operational code of the program without complications. Quines are implemented differently in different programming languages, and many programmers have built their own versions of quine code that attempt to achieve this goal most efficiently and with the least amount of source code.

Since building a true quine requires a certain level of recursion and self-referencing resources using things like arrays, string interpolation and strategies that call multiple parts of code separately, it is thought of as a challenging programming task. But experts point out that much of this challenge is related to the syntax of modern programming languages — using the example of early basic code. Under this type of early programming language, a programmer can simply create a command to print the contents of each piece of linear code using a "for" loop or, as others suggest, similar results could be obtained simply by programming a single "list" command. However, there is a consensus that this type of easy quine really constitutes cheating and that the true execution of this type of program is manifested in the products of various programmers using languages like Perl, Python, Java, C or other more modern and complex languages.