Log in

No account? Create an account

Previous Entry | Next Entry

Hello World!

Remember your first computer program? Mine was something like this:
10 REM Hello World in BASIC
20 PRINT "Hello World!"
In fact "Hello World" or some variant is the first piece of code that most people cut - especially when trying to get to grips with a new language. There's something rather enjoyable about seeing that hunk of metal and plastic suddenly do just what you told it to do.

So how about 206 different "Hello World" implementations, in as many different languages?


( 4 comments — Leave a comment )
(Deleted comment)
Jul. 14th, 2005 01:26 pm (UTC)
I think mine was the same but with "Share and Enjoy" replacing the swearword. Later efforts had it loop a couple of hundred times then print "Go stick your head in a pig."
(Deleted comment)
(Deleted comment)
Jul. 14th, 2005 04:14 pm (UTC)
That's not the function of "Hello World" though. Its function is to be the smallest possible (plus a dozen superfluous chars, because pedantry is boring) program that works and makes output. It is not a demonstration of your r4d sk1llz, nor the clever language features. For most languages you can assume that the language and output works, so Hello World is more about proving out your compost-and-leak process, rather than proving the capabilties of the language. Admittedly for old FORTRANs it was easier to calculate pi than it was to output a Hollerith string, so "1234" is a moral equivalent.

It once took me nearly 3 days to write Hello World, along with the efforts of a contractor sitting opposite my desk. It was CORAL 66 (on an ITL mini) and the first task was to have the contractor write an IO library in embedded assembler. Definitely the nastiest commercial platform I've ever had to code for.
Jul. 14th, 2005 03:00 pm (UTC)
Monad/MSH (http://www.proudlyserving.com/ is Adam's blog and the best description outside of the beta site) is missing from the list. I've been in touch with the folks here at Microsoft and suggested they contribute the Monad version to the list.

Which, incidentally, is probably the smallest implementation in existence. Here it is:

"Hello world!"

That's it really.
Jul. 15th, 2005 12:55 am (UTC)
This has go me thinking about the origins of the use of "Hello World" .

I think the first time I came across it was doing C.
When I was messing with BASIC, Algol, COBOL, Fortran and misc Assemblers it didn't crop up.

Now it seems all languages start with it.

There's a research project there to find the first one, like the people who tracked down the bastard that invented the emoticon.
( 4 comments — Leave a comment )