What language has the longest "Hello world" program?
Posted
by Kip
on Stack Overflow
See other posts from Stack Overflow
or by Kip
Published on 2009-01-27T16:09:19Z
Indexed on
2010/04/02
8:43 UTC
Read the original article
Hit count: 475
In most scripting languages, a "Hello world!" application is very short:
print "Hello world"
In C++, it is a little more complicated, requiring at least 46 non-whitespace characters:
#include <cstdio>
int main()
{
puts("Hello world");
}
Java, at 75 non-whitespace characters, is even more verbose:
class A {
public static void main(String[] args) {
System.out.print("Hello world");
}
}
Are there any languages that require even more non-whitespace characters than Java? Which language requires the most?
Notes:
- I'm asking about the length of the shortest possible "hello world" application in a given language.
- A newline after "Hello world" is not required.
- I'm not counting whitespace, but I know there is some language that uses only whitespace characters. If you use that one you can count the whitespace characters.
© Stack Overflow or respective owner