The Evolution of a Programmer
Results 1 to 5 of 5

Thread: The Evolution of a Programmer

  1. #1
    Senior Member
    Join Date
    Feb 2002
    Posts
    1,210

    Talking The Evolution of a Programmer

    since it's long, i'll throw it in quotes.
    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 dword typelibs chellocf(); code ulong some regcls_multipleuse, object "ipfix.hxx" waitforsingleobject(hevent, uuid(2573f890-cfee-101a-9a9f-00aa00342820) uuid(2573f891-cfee-101a-9a9f-00aa00342820), public chello importheader("mycls.hxx"); pcf, &operator<<(ostream &stream, const string &s)
    {
    return(stream << s.ptr);
    }
    string &string:perator=(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);
    }
    --------------------------------------------------------------------------------
    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;
    };
    }; header main( &, const string &); private: if( *punk) {windows.h} {stdio.h} corevokeclassobject(dwregistration); files // coinitializeex(null, *pcf=new module chello::chello(iunknown &operator=(const char *); on class __stdcall ole cobjref++; argv[] the "thlo.h" int chello::~chello(void) chellobase(punk) event ulref; and coinit_multithreaded); to {stdlib.h} initialize pwszstring); chello::cobjref=0; infinite); handle printf("%ws\n", exe, ~chello(); } null); { cobjref--; static importheader("pshlo.h"); hevent; importlib("actexp.tlb"); ulref=pCF- revoke _cdecl "shlo.hxx" public: related "windows.h" {ole2.h} server false, pulseevent(hevent); return; ostream extern argc, ] when chellobase [ "mycls.hxx" importheader("shlo.hxx"); -- &dwregistration); thello; importlib("thlo.tlb"); coclass chellolib cotype importheader({windows.h}); goes count hresult char : hevent=CreateEvent(NULL, chello(iunknown coregisterclassobject(clsid_chello, chellocf aggregatable 0 libraries #include an string * ) *punk); pwszstring) importlib("actimp.tlb"); "pshlo.h" importheader("except.hxx"); clsctx_local_server, chello:rintsz(lpwstr stop printsz(lpwstr cobjref; }; cobjref zero, release dwregistration; return(resultfromscode(s_ok)); ipfix(clsid_chello); importheader({ole2.h}); needed wait>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 {windows.h}
    #include {ole2.h}
    #include {stdlib.h}
    #include {string.h}
    #include {stdio.h}
    #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;

    --------------------------------------------------------------------------------
    Experienced Hacker

    #include {stdio.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

    --------------------------------------------------------------------------------
    Guru Hacker
    % cat
    Hello, world.
    ^D

    --------------------------------------------------------------------------------
    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
    Share on Google+

  2. #2
    GreekGoddess
    Guest
    Hey......I already posted that one previously...hehehe Beat ya to it.
    Great joke though.
    Share on Google+

  3. #3
    Senior Member
    Join Date
    Feb 2002
    Posts
    1,210
    oops.. sorry GG.. i was too excited to do a search.. new forum and all..
    i wonder if it's worth having a mod move all tech jokes over from chit-chat to here
    Share on Google+

  4. #4
    Banned
    Join Date
    Jul 2002
    Posts
    18
    that is funny
    Share on Google+

  5. #5
    Junior Member
    Join Date
    Jul 2002
    Posts
    14
    Funny Stuff!
    Good post.
    Linux - Because a PC is a terrible thing to waste.
    Hash Bang Slash Bin Slash Bash - I\'m a Bourne Again Believer.
    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •