Posted By: littleguru | Jun 25th, 2006 @ 12:40 AM
page 1 of 1
Comments: 13 | Views: 2734
littleguru
littleguru
<3 Seattle

How the way people code "Hello World" varies depending on their age and job:

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 <stdio.h>

void main(void)
{
 char *message[] = {"Hello ", "World"};
 int i;
 for(i = 0; i < 2; ++i)
 printf("%s", message[i]);
 printf("\n");
}


Seasoned professional
#include <iostream.h>
#include <string.h>
class string
{
 private:
  int size;
  char *ptr;
 public:
  string() : size(0), ptr(new char('\0')) {}
  string(const string &s) : size(s.size)
  {
    ptr = new char[size + 1];
    strcpy(ptr, s.ptr);
  }
  ~string()
  {
    delete [] ptr;
  }
  friend ostream &operator <<(ostream &, const string &);
  string &operator=(const char *);
};

ostream &operator<<(ostream &stream, const string &s)
{
  return(stream << s.ptr);
}
string &string::operator=(const char *chrs)
{
  if (this != &chrs)
  {
    delete [] ptr;
    size = strlen(chrs);
    ptr = new char[size + 1];
    strcpy(ptr, chrs);
  }
  return(*this);
}
int main()
{
  string str;
  str = "Hello World";
  cout << str << endl;
  return(0);
}


System Administrator
#include <stdio.h>
#include <stdlib.h>
main()
{
 char *tmp;
 int i=0;
 /* on y va bourin */
 tmp=(char *)malloc(1024*sizeof(char));
 while (tmp[i]="Hello Wolrd"[i++]);
 /* Ooopps y'a une infusion ! */
 i=(int)tmp[8];
 tmp[8]=tmp[9];
 tmp[9]=(char)i;
 printf("%s\n",tmp);
}


Apprentice Hacker

#!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0) {
    while(defined($arg=shift(@ARGV))) {
        $outfilename = $arg;
        open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";
        print (FILE $msg);
        close(FILE) || die "Can't close $arg: $!\n";
    }
} else {
    print ($msg);
}
1;


Experienced Hacker

#include <stdio.h>
#include <string.h>
#define S "Hello, World\n"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}


Seasoned Hacker
% cc -o a.out ~/src/misc/hw/hw.c
% a.out
Hello, world.


Guru Hacker
% cat
Hello, world.


New Manager (do you remember?)

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

Custa1200
Custa1200
Havok13andaThird
Amusing coz it's true Smiley
Angus
Angus
.
Amusing and interesting.

Angus Higgins
That's Great Big Smile

This is was my first one:










 Dang It!





Big Smile
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
littleguru wrote:


Seasoned professional
#include <iostream.h>
#include <string.h>


Wow, a "seasoned professional" who uses the deprecated (not to mention removed in VC7.1+) <iostream.h> and who writes his own string class based on <string.h> (which should be included as <cstring> in C++).

Some professional. Tongue Out
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
littleguru wrote:
That's 15 years ago... He is now CEO.

15 years ago a seasoned professional would've been using Cobol or Fortran, not C++. Tongue Out
littleguru wrote:

Sven Groot wrote:
littleguru wrote: That's 15 years ago... He is now CEO.

15 years ago a seasoned professional would've been using Cobol or Fortran, not C++.


OMG. Take it as it is... I mean I got it from somebody else and thought it might be funny... It's a joke. Take it as a joke.

I think it is funny.

Keep the jokes coming.

(The seasoned professional, now CEO, could be an early adopter...)
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
littleguru wrote:

Sven Groot wrote: 
littleguru wrote: That's 15 years ago... He is now CEO.

15 years ago a seasoned professional would've been using Cobol or Fortran, not C++.


OMG. Take it as it is... I mean I got it from somebody else and thought it might be funny... It's a joke. Take it as a joke.

I was joking as well! Smiley
littleguru wrote:


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

Syntax error:

Your "Hello World in Pascal" have a missing semicolon after writeln()...

And you've missed one class:

Beginner System Administrator wrote:

#!/bin/sh

echo "Hello World!"


Cairo
Cairo
I want my waffle sundae, give me my carbs!
Of course "Hello World" is a scalable SOA 2.0-based web service enterprise integration platform. Does anyone know where I can find the WSDL for "Hello World"?


Oh yes, here's one.
DoomBringer
DoomBringer
Doom!

Actually the CEO/manager types would have asked for a "Greetings moon!" program, and then complained when the resulting program didn't display "Hello, World!".  Of course, when the competitor announces "Salutations, planetoid!" we have to shift all our dev efforts to "Well met, dirtbag!" in order to compete.

Of course, there is a bug in "Well met, dirtbag!"

Management will ask to remove the word "met" and somehow work in the word "synergistic version". 

page 1 of 1
Comments: 13 | Views: 2734
Microsoft Communities