Evolution of a Programmer: ========================== The goal is to produce a program that prints "HELLO WORLD" on the screen: -------------- Senior in High School: 10 PRINT "HELLO WORLD" 20 END -------------- College Freshman: program HELLO(input, output) begin writeln('HELLO WORLD') end. -------------- Junior in College: (defun HELLO (print (cons HELLO (list 'WORLD)))) -------------- Just graduated: #include [stdio.h] void main(void) ( char *message[] = ("HELLO ", "WORLD"); int i; for(i = 0; i [ 2; ++i) printf("%s", message[i]); printf("|n"); ) -------------- Experienced 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) main() ( char *tmp; int i=0; /* on y va bourin */ tmp=(char *)malloc(1024*sizeof(char)); while (tmp[i]="HELLO WORLD"[i++]); /* Ooopps...here comes an insertion ! */ i=(int)tmp[8]; tmp[8]=tmp[9]; tmp[9]=(char)i; printf("%s|n",tmp); ) -------------- Beginner 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] #define S "HELLO, WORLD|n" main()(exit(printf(S) == strlen(S) ? 0 : 1);) -------------- Very experienced Hacker: % cc -o a.out ~ /src/misc/bv/bv.c % a.out -------------- Hacker Guru: % cat HELLO, WORLD. ^D -------------- Junior Director: 10 PRINT "HELLO WORLD" 20 END -------------- Director: mail -s "HELLO, WORLD." bob@b12 Henry, could you please write me a short program which types "HELLO, WORLD." on the screen. I need it by tomorrow. ^D -------------- Senior Director: % zmail John I need a "HELLO, WORLD" program by this afternoon. -------------- CEO: % letter letter: Command not found. % mail To: ^X ^F ^C % help mail help: Command not found. % damn! !: Event unrecognized % logout