December 21, 2005

"Hello World"

The first usable program presented in the original Kernigan and Ritchie book on the C Programming Language was one that when run, would output the text: "Hello World" to the screen or printer. Here is a list of how various people would write the same application:

    High School/Jr.High
    ===================

    10 PRINT "HELLO WORLD"
    20 END


    First year in College
    =====================
    program Hello(input, output)
      begin
	writeln('Hello World')
      end.


    Senior year in College
    ======================
    (defun hello
      (print
	(cons 'Hello (list 'World))))


    New professional
    ================
    #include 
    void main(void)
    {
      char *message[] = {"Hello ", "World"};
      int i;

      for(i = 0; i < 2; ++i)
	printf("%s", message[i]);
      printf("\n");
    }

All the way through: Seasoned professional, Master Programmer, Apprentice Hacker, Experienced Hacker, Seasoned Hacker and Guru Hacker. The list ends with these three:
    New Manager
    ===================

    10 PRINT "HELLO WORLD"
    20 END


    Middle Manager
    ===================

    mail -s "Hello, world." bob@b12
    Bob, could you please write me a program that prints "Hello, world."?
    I need it by tomorrow.
    ^D


    Senior Manager
    ===================

    % zmail jim
    I need a "Hello, world." program by this afternoon.


    Chief Executive
    ===================

    % letter
    letter: Command not found.
    % mail
    To: ^X ^F ^C
    % help mail
    help: Command not found.

    % damn!
    !: Event unrecognized
    % logout

-----------------
Posted by DaveH at December 21, 2005 4:43 PM
Comments
Post a comment









Remember personal info?