De: Sergio Tognolotti <sanctuary@inea.com.ar>
Para: Carlos Jaacks <jaacks@hightoro.com.ar>
CC: Tomas Gumpel <tgumpel@hal-pc.org>; Sebastian Levis <slevis@sminter.com.ar>; Santiago Molinari <molix@inea.com.ar>; Rodo <rodo@newage.com.ar>; Roberto Puente <quehay@hotmail.com>; Roberto Orlandoni <rao@inea.com.ar>; Leonardo Bocci <lbocci@sminter.com.ar>; Leonardo Salguero <nexo@icanect.net>; julio roca <juroca@fibertel.com.ar>; Hernan Varela <hvarela@sminter.com.ar>; Haim Dorin <hdorin@shaam.gov.il>; Gustavo Carrizo <gcarrizo@cvtci.com.ar>; Guillermo Henrich <gheinrich@telefe.com.ar>; Flavio Villanustre <flavio@linux.inea.com.ar>; Egon Medinger <medinger@anses.gov.ar>; Eduardo Tobis <lucifer@ssdnet.com.ar>; Diego Salguero <dsalguero@memotec.com.ar>; Diego Berardo <diego.berardo@ar.eyi.com>; Daniel Marazzo <dmarazzo@fibertel.com.ar>
Asunto: The Evolution of a Programmer
Fecha: Lunes 3 de Mayo de 1999 22:21


by Richard Perlotto

To perform this study, programmers of all levels were asked to write a
program able to display "Hello World" through the standard output. Here are
the results:


----------------------------------------------------------------------------

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))))


----------------------------------------------------------------------------

DOS Newbie
@echo off
:top
echo "Hello, World!"
goto top


----------------------------------------------------------------------------

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

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


----------------------------------------------------------------------------

Seasoned Professional
#include
#include

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);
}


----------------------------------------------------------------------------

Very Seasoned Professional
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300 DATE-WRITTEN. 02/05/96 21:04.
000400* AUTHOR BRIAN COLLINS
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.
001100 FILE SECTION.
001200
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500 DISPLAY "HELLO, WORLD." LINE 15 POSITION 10.
100600 STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800 EXIT.


----------------------------------------------------------------------------

Master Programmer
[
uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
]
library LHello
{
// bring in the master library
importlib("actimp.tlb");
importlib("actexp.tlb");

// bring in my interfaces
#include "pshlo.idl"

[
uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
]
cotype THello
{
interface IHello;
interface IPersistFile;
};
};

[
exe,
uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
]
module CHelloLib
{

// some code related header files
importheader();
importheader();
importheader();
importheader("pshlo.h");
importheader("shlo.hxx");
importheader("mycls.hxx");

// needed typelibs
importlib("actimp.tlb");
importlib("actexp.tlb");
importlib("thlo.tlb");

[
uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
aggregatable
]
coclass CHello
{
cotype THello;
};
};

#include "ipfix.hxx"
extern HANDLE hEvent;
class CHello : public CHelloBase
{
public:
IPFIX(CLSID_CHello);

CHello(IUnknown *pUnk);
~CHello();

HRESULT __stdcall PrintSz(LPWSTR pwszString);

private:
static int cObjRef;
};

#include
#include
#include
#include
#include "thlo.h"
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"

int CHello:cObjRef = 0;

CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)
{
cObjRef++;
return;
}

HRESULT __stdcall CHello::PrintSz(LPWSTR pwszString)
{
printf("%ws\n", pwszString);
return(ResultFromScode(S_OK));
}


CHello::~CHello(void)
{

// when the object count goes to zero, stop the server
cObjRef--;
if( cObjRef == 0 )
PulseEvent(hEvent);

return;
}

#include
#include
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"

HANDLE hEvent;

int _cdecl main(
int argc,
char * argv[]
) {
ULONG ulRef;
DWORD dwRegistration;
CHelloCF *pCF = new CHelloCF();

hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

// Initialize the OLE libraries
CoInitiali, NULL);

// Initialize the OLE libraries
CoInitializeEx(NULL, COINIT_MULTITHREADED);

CoRegisterClassObject(CLSID_CHello, pCF,
CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE,
&dwRegistration);

// wait on an event to stop
WaitForSingleObject(hEvent, INFINITE);

// revoke and release the class object
CoRevokeClassObject(dwRegistration);
ulRef = pCF->Release();

// Tell OLE we are going away.
CoUninitialize();

return(0); }

extern CLSID CLSID_CHello;
extern UUID LIBID_CHelloLib;

CLSID CLSID_CHello = {
/* 2573F891-CFEE-101A-9A9F-00AA00342820 */
0x2573F891,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};

UUID LIBID_CHelloLib = {
/* 2573F890-CFEE-101A-9A9F-00AA00342820 */
0x2573F890,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};

#include
#include
#include
#include
#include
#include "pshlo.h"
#include "shlo.hxx"
#include "clsid.h"

int _cdecl main(
int argc,
char * argv[]
) {
HRESULT hRslt;
IHello *pHello;
ULONG ulCnt;
IMoniker * pmk;
WCHAR wcsT[_MAX_PATH];
WCHAR wcsPath[2 * _MAX_PATH];

// get object path
wcsPath[0] = '\0';
wcsT[0] = '\0';
if( argc > 1) {
mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
wcsupr(wcsPath);
}
else {
fprintf(stderr, "Object path must be specified\n");
return(1);
}

// get print string
if(argc > 2)
mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
else
wcscpy(wcsT, L"Hello World");

printf("Linking to object %ws\n", wcsPath);
printf("Text String %ws\n", wcsT);

// Initialize the OLE libraries
hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);

if(SUCCEEDED(hRslt)) {

hRslt = CreateFileMoniker(wcsPath, &pmk);
if(SUCCEEDED(hRslt))
hRslt = BindMoniker(pmk, 0, IID_IHello,
(void **)&pHello);

if(SUCCEEDED(hRslt)) {

// print a string out
pHello->PrintSz(wcsT);

Sleep(2000);
ulCnt = pHello->Release();
}
else
printf("Failure to connect, status: %lx", hRslt);

// Tell OLE we are going away.
CoUninitialize();
}

return(0);
}


----------------------------------------------------------------------------

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;


----------------------------------------------------------------------------

CP/M Hacker
Title "Hello, World!"
;
; Program: HELLOW.MAC
; Enviroment: M80 (Microsoft Macro Assembler) source
;
ORG 0100H
Print: LD HL,10H
PUSH HL
LOOP:
LD DE,MSG
LD C,09H ; CP/M write string to console
CALL 0005H

POP HL ; Get loop counter
DEC HL ; and decriment it

PUSH HL ; Put back on stack

LD A,L
JR NZ, LOOP ; Loop while not zero

POP HL ; Clean up stack

LD C,00H ; CP/M system reset - shut down
CALL 0005H

HALT ; This code is never reached

MSG:
TEXT "Hello, World!"
DB 0Ah
DB "$" ; Line terminator
ENDM Print


----------------------------------------------------------------------------

DOS Hacker
title Hello World Program (hello.asm)
; This program displays "Hello, World!"

dosseg
.model small
.stack 100h

.data
hello_message db 'Hello, World!',0dh,0ah,'$'

.code
main proc
mov ax,@data
mov ds,ax

mov ah,9
mov dx,offset hello_message
int 21h

mov ax,4C00h
int 21h
main endp
end main


----------------------------------------------------------------------------

Experienced Hacker
#include
#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


----------------------------------------------------------------------------

DTP Hacker
%!PS
1.00000 0.99083 scale
/Courier findfont 12 scalefont setfont
0 0 translate
/row 769 def
85 {/col 18 def 6 {col row moveto
(Hello World)show /col col 90 add def}
repeat /row row 9 sub def} repeat
showpage save restore


----------------------------------------------------------------------------

Master Hacker
cat =13 /*/ >/dev/null 2>&1; echo "Hello, world!"; exit
*
* This works under K&R cc, f77, /bin/ksh and /bin/sh.
*
*/; main() {
write(
cat-~-cat
/*,'(
*/
,"Hello, world!"
,
cat); putchar(~-~-~-cat); } /*
,)')
end
*/
showpage save restore


----------------------------------------------------------------------------

Ancient Hacker
,008015,022029,036043,050054,055062,063065,066077
/333/M0762502F1.HELLO WORLD

This is a self loading card for the IBM 1401 that
you run by putting the card in the reader and
hitting START.
The program will print HELLO WORLD, eject the page,
and halt.


----------------------------------------------------------------------------

Guru Hacker
% cat
Hello, world.
^D


----------------------------------------------------------------------------

AXE System programmer
LL0:
.seg "data"
.seg "text"
.proc 04
.global _main
_main:
!#PROLOGUE# 0
sethi %hi(LF26),%g1
add %g1,%lo(LF26),%g1
save %sp,%g1,%sp
!#PROLOGUE# 1
.seg "data1"
L30:
.ascii "Hello, World\012\0"
.seg "text"
.seg "data1"
L32:
.ascii "Hello, World\012\0"
.seg "text"
set L32,%o0
call _strlen,1
nop
mov %o0,%i5
set L30,%o0
call _printf,1
nop
cmp %o0,%i5
bne L2000000
nop
mov 0,%o0
b L2000001
nop
L2000000:
mov 0x1,%o0
L2000001:
call _exit,1
nop
LE26:
ret
restore
LF26 = -96
LP26 = 96
LST26 = 96
LT26 = 96
.seg "data"

0000000 0103 0107 0000 0060 0000 0020 0000 0000
0000020 0000 0030 0000 0000 0000 0054 0000 0000
0000040 033f ffff 8200 63a0 9de3 8001 1100 0000
0000060 9012 2000 4000 0000 0100 0000 ba10 0008
0000100 1100 0000 9012 2000 4000 0000 0100 00ba
0000120 80a2 001d 1280 0005 0100 0000 9010 2000
0000140 1080 0003 0100 0000 9010 2001 4000 0000
0000160 0100 0000 81c7 e008 81e8 0000 0000 0000
0000200 4865 6c6c 6f2c 2057 6f72 6c64 0a00 4865
0000220 6c6c 6f2c 2057 6f72 6c64 0a00 0000 0000
0000240 0000 000c 0000 0608 0000 006e 0000 0010
0000260 0000 060b 0000 006e 0000 0014 0000 0286
0000300 ffff ffec 0000 0020 0000 0608 0000 0060
0000320 0000 0024 0000 060b 0000 0060 0000 0028
0000340 0000 0186 ffff ffd8 0000 004c 0000 0386
0000360 ffff ffb4 0000 0004 0500 0000 0000 0000
0000400 0000 000a 0100 0000 0000 0000 0000 0012
0000420 0100 0000 0000 0000 0000 001a 0100 0000
0000440 0000 0000 0000 0020 5f6d 6169 6e00 5f70
0000460 7269 6e74 6600 5f73 7472 6c65 6e00 5f65
0000500 7869 7400
0000504

% axe_generate -f system.uhdl
Application 'Exchange' generated
2324042350000000 source code lines
No Errors detected.
Hardware retrieval...done OK
Certification Test...done OK
Packing..............done OK
Delivery.............done OK
Application 'Exchange' delivered to customer
23456000 bytes/sec.
End processing, 2345 seconds.


----------------------------------------------------------------------------

Ultra high level programmer
system.uhdl :

SYSTEM
CREATE ScreenWin
SIZE 20000000/Unit=One
DESTINATION Order.dest[One]
OUTPUT CHARACTER['Hello world']
END
END


----------------------------------------------------------------------------

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 all

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


----------------------------------------------------------------------------

Chief Executive
% message
message: Command not found
% pm
pm: Command not found
% letter
letter: Command not found.
% mail
To: ^X ^F ^C
> help mail
help: Command not found.
>what
what: Command not found
>need help
need: Command not found
> damn!
!: Event unrecognized
>exit
exit: Unknown
>quit
%
% logout

Bipppp ! Mrs Thomsson ?
Please page Tommy for me.
NOW !