hello world

Hello World

(This is just an example article taken from Wikipedia)

A "Hello, World!" program is a computer program that outputs or displays Hello, World! to a user. Being a very primitive simple program in most programming languages, it is often used to illustrate the basic syntax of a programming language for a working program. It is often the very first program people write when they are new to a language.

The phrase is also used as a proof of concept that arbitrary code can be executed through an exploit where the system designers did not intend code to be executed.



Purpose

A "Hello, World!" program is traditionally used to introduce novice programmers to a programming language. "Hello, world!" is also traditionally used in a sanity test to make sure that a computer language is correctly installed, and that the operator understands how to use it.

Time to Hello World

TTHW is the time it takes to author a "Hello, World!" program in a given programming language. This is one measure of a programming language's ease-of-use.

History

While small test programs have existed since the development of programmable computers, the tradition of using the phrase "Hello, world!" as a test message was influenced by an example program in the seminal book The C Programming Language.

Examples

There are many variations on the punctuation and casing of the phrase. Variations include the presence or absence of the comma and exclamation mark, and the capitalization of the 'H', both the 'H' and the 'W', or neither.

1974 C version

The example program from that book prints hello, world (without capital letters or exclamation mark), and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C.A Tutorial:

1
2
3
4
5
6
#include <stdio.h>

main( )
{
    printf("hello, world\n");
}
1972 B version

The C 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:

1
2
3
4
5
6
7
8
main(){
  extrn a,b,c;
  putchar(a); putchar(b); putchar(c); putchar("!*n");
  }

a "hell";
b "o, w";
c "orld";
Modern languages

For modern languages, hello, world programs vary in sophistication.

Language What demonstrated
Go Multilingual "Hello, world"
Java "Hello, world" based on scalable vector graphics
XL A spinning Earth "Hello, world" using 3D graphics
Perl, Python, Ruby "Hello, world" as a single statement

See also

  • Foobar
  • Just another Perl hacker
  • List of basic computer science topics 💻
  • "99 Bottles of Beer" as used in computer science
    • Infinity bottles of beer on the wall :beer:
    • Aleph-null bottles of beer on the wall
  • Java Pet Store
  • Trabb Pardo-Knuth algorithm

TODO

  • Use checklists
  • Use checklists to demonstrate something useful

Images can be links too Text.is

Edit
Pub: 06 Sep 2023 08:42 UTC
Update: 09 Oct 2023 19:34 UTC
views: 302

New· How· IP.IM· Contact· Issue

Text.is - Markdown Pastebin.