Code golf
Encyclopedia
Code golf is a type of computer programming competition in which participants strive to achieve the shortest possible code that implements a certain algorithm
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

. Such tournaments may also be named with the programming language used (for example Perl golf).

History

Whilst the term was apparently first used in 1999 with Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

, and later popularised through the use of Perl to write a program that performed RSA encryption, similar informal competition was known to have been popular with earlier APL
APL
-Organizations:*Advanced Production and Loading, a Norwegian marine engineering company formed in 1993.*Party of Labour of Albania, the sole legal political party in Albania during communist rule...

 hackers and probably others. Today the term has grown to be applied to a wide variety of languages.

Etymology

The term is derived from the similarity of its scoring system with that of conventional golf
Golf
Golf is a precision club and ball sport, in which competing players use many types of clubs to hit balls into a series of holes on a golf course using the fewest number of strokes....

 - ie: participants seek to achieve the lowest possible score, rather than the highest as is the standard in most sports' scoring systems.

Types of code golf

Some code golf questions, such as those posed on general programming sites, may not require implementation in a specific programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

. However, this is limits the style of problems that it is possible for the problem designers to pose (for example, by limiting the use of certain language features). In addition, the creation of such 'open' questions has resulted in the design of code golf specific programming language dialects such as REBMU (a dialect of REBOL
REBOL
REBOL is a cross-platform data exchange language and a multi-paradigm dynamic programming language originally designed by Carl Sassenrath for network communications and distributed computing. The language and its official implementation, which is a proprietary freely redistributable software are...

). Both online and live competitions may also include time limits.

Tournaments by language

  • Clojure
    Clojure
    Clojure |closure]]") is a recent dialect of the Lisp programming language created by Rich Hickey. It is a general-purpose language supporting interactive development that encourages a functional programming style, and simplifies multithreaded programming....

  • K
    K (programming language)
    K is a proprietary array processing language developed by Arthur Whitney and commercialized by Kx Systems. The language serves as the foundation for kdb, an in-memory, column-based database, and other related financial products. The language, originally developed in 1993, is a variant of APL and...

  • PHP
    PHP
    PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

  • Perl
    Perl
    Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

    • Historical
      • 2000, July: Perl Golf Apocalypse
        Perl Golf Apocalypse
        Perl Golf Apocalypse is a Perl coding competition with the objective of solving a basic programming task with the smallest perl code possible. The competition has its roots in the newsgroup comp.lang.perl.misc which had threads where each poster tried to solve a basic problem with shorter code...

         at Perl Conference 4.0, Monterey California
        California
        California is a state located on the West Coast of the United States. It is by far the most populous U.S. state, and the third-largest by land area...

        .

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK