"Hello, World!" program

From Wikipedia for FEVERv2
Revision as of 00:05, 12 January 2021 by imported>Unknown user
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

"Hello World" redirects here. "Hello, World!" program_sentence_0

For other uses, see Hello World (disambiguation). "Hello, World!" program_sentence_1

A "Hello, World!" "Hello, World!" program_sentence_2

program generally is a computer program that outputs or displays the message "Hello, World!". "Hello, World!" program_sentence_3

Such a program is very simple in most programming languages, and is often used to illustrate the basic syntax of a programming language. "Hello, World!" program_sentence_4

It is often the first program written by people learning to code. "Hello, World!" program_sentence_5

It can also be used as a sanity test to make sure that a computer language is correctly installed, and that the operator understands how to use it. "Hello, World!" program_sentence_6

History "Hello, World!" program_section_0

While small test programs have existed since the development of programmable computers, the tradition of using the phrase "Hello, World!" "Hello, World!" program_sentence_7

as a test message was influenced by an example program in the seminal 1978 book The C Programming Language. "Hello, World!" program_sentence_8

The example program in that book prints "hello, world", and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial: "Hello, World!" program_sentence_9

In the above example, the main( ) function defines where the program should start executing. "Hello, World!" program_sentence_10

The function body consists of a single statement, a call to the printf function, which stands for "print formatted". "Hello, World!" program_sentence_11

This function will cause the program to output whatever is passed to it as the parameter, in this case the string hello, world, followed by a newline character. "Hello, World!" program_sentence_12

The C language version was preceded by Kernighan's own 1972 A Tutorial Introduction to the Language B, where the first known version of the program is found in an example used to illustrate external variables: "Hello, World!" program_sentence_13

The program also prints hello, world! "Hello, World!" program_sentence_14

on the terminal, including a newline character. "Hello, World!" program_sentence_15

The phrase is divided into multiple variables because in B, a character constant is limited to four ASCII characters. "Hello, World!" program_sentence_16

The previous example in the tutorial printed hi! "Hello, World!" program_sentence_17

on the terminal, and the phrase hello, world! "Hello, World!" program_sentence_18

was introduced as a slightly longer greeting that required several character constants for its expression. "Hello, World!" program_sentence_19

The claims that "Hello, World!" "Hello, World!" program_sentence_20

originated instead with BCPL (1967). "Hello, World!" program_sentence_21

This claim is supposedly supported by the archived notes of the inventors of BCPL, Brian Kernighan at Princeton and Martin Richards at Cambridge. "Hello, World!" program_sentence_22

The phrase predated by over a decade its usage in computing; as early as the 1950s, it was the catchphrase of radio disc jockey William B. Williams. "Hello, World!" program_sentence_23

Variations "Hello, World!" program_section_1

"Hello, World!" "Hello, World!" program_sentence_24

programs vary in complexity between different languages. "Hello, World!" program_sentence_25

In some languages, particularly scripting languages, the "Hello, World!" "Hello, World!" program_sentence_26

program can be written as a single statement, while in others (particularly many low-level languages) there can be many more statements required. "Hello, World!" program_sentence_27

For example, in Python, to print the string Hello, World! "Hello, World!" program_sentence_28

followed by a newline, one need only write print("Hello, World!"). "Hello, World!" program_sentence_29

In contrast, the equivalent code in C++ requires the import of the input/output software library, the manual declaration of an entry point, and the explicit instruction that the output string should be sent to the standard output stream. "Hello, World!" program_sentence_30

Generally, programming languages that give the programmer more control over the machine will result in more complex "Hello, World" programs. "Hello, World!" program_sentence_31

The phrase "Hello World!" "Hello, World!" program_sentence_32

has seen various deviations in punctuation and casing, such as the presence of the comma and exclamation mark, and the capitalization of the leading H and W. Some devices limit the format to specific variations, such as all-capitalized versions on systems that support only capital letters, while some esoteric programming languages may have to print a slightly modified string. "Hello, World!" program_sentence_33

For example, the first non-trivial Malbolge program printed "HEllO WORld", this having been determined to be good enough. "Hello, World!" program_sentence_34

Other human languages have been used as the output; for example, a tutorial for the Go programming language outputted both English and Chinese characters, demonstrating the programming language's built-in Unicode support. "Hello, World!" program_sentence_35

Some languages change the functionality of the "Hello, World!" "Hello, World!" program_sentence_36

program while maintaining the spirit of demonstrating a simple example. "Hello, World!" program_sentence_37

Functional programming languages, such as Lisp, ML and Haskell, tend to substitute a factorial program for "Hello, World! "Hello, World!" program_sentence_38

", as functional programming emphasizes recursive techniques, whereas the original examples emphasize I/O, which violates the spirit of pure functional programming by producing side effects. "Hello, World!" program_sentence_39

Languages otherwise capable of printing "Hello, World!" "Hello, World!" program_sentence_40

(Assembly, C, VHDL) may also be used in embedded systems, where text output is either difficult (requiring additional components or communication with another computer) or nonexistent. "Hello, World!" program_sentence_41

For devices such as microcontrollers, field-programmable gate arrays, and CPLDs, "Hello, World!" "Hello, World!" program_sentence_42

may thus be substituted with a blinking LED, which demonstrates timing and interaction between components. "Hello, World!" program_sentence_43

The Debian and Ubuntu Linux distributions provide the "Hello, World!" "Hello, World!" program_sentence_44

program through their software package manager systems, which can be invoked with the command hello. "Hello, World!" program_sentence_45

It serves as a sanity check and a simple example of installing a software package. "Hello, World!" program_sentence_46

For developers, it provides an example of creating a .deb package, either traditionally or using debhelper, and the version of hello used, GNU Hello, serves as an example of writing a GNU program. "Hello, World!" program_sentence_47

Variations of the "Hello, World!" "Hello, World!" program_sentence_48

program that produce a graphical output (as opposed to text output) have also been shown. "Hello, World!" program_sentence_49

Sun demonstrated a "Hello, World!" "Hello, World!" program_sentence_50

program in Java based on scalable vector graphics, and the XL programming language features a spinning Earth "Hello, World!" "Hello, World!" program_sentence_51

using 3D computer graphics. "Hello, World!" program_sentence_52

Mark Guzdial and Elliot Soloway have suggested that the "hello, world" test message may be outdated now that graphics and sound can be manipulated as easily as text. "Hello, World!" program_sentence_53

Time to Hello World "Hello, World!" program_section_2

"Time to hello world" (TTHW) is the time it takes to author a "Hello, World!" "Hello, World!" program_sentence_54

program in a given programming language. "Hello, World!" program_sentence_55

This is one measure of a programming language's ease-of-use; since the program is meant as an introduction for people unfamiliar with the language, a more complex "Hello, World!" "Hello, World!" program_sentence_56

program may indicate that the programming language is less approachable. "Hello, World!" program_sentence_57

The concept has been extended beyond programming languages to APIs, as a measure of how simple it is for a new developer to get a basic example working; a faster time indicates an easier API for developers to adopt. "Hello, World!" program_sentence_58

See also "Hello, World!" program_section_3

"Hello, World!" program_unordered_list_0


Credits to the contents of this page go to the authors of the corresponding Wikipedia page: en.wikipedia.org/wiki/"Hello, World!" program.