Written as Code: The Ten Commandments



God theLord = new God();
ThyNeighbor thyNewb = new ThyNeighbor();

  1. Original: Thou shalt have no other gods before me

    Code:

    std::list<God> AllOtherGods = new std::list<God>();
    AllOtherGods.insert(AllOtherGods.begin(), theLord);

  2. Original: Thou shalt not take the name of the Lord thy God in vain

    Code:

    #include
    WINDOW *scrn = initscr();
    mvaddstr(0, 0, theLord.name.c_str());

  3. Original: Remember the Sabbath, to keep it holy

    Code:

    mktime(&timeStruct);
    if (!timeStruct.tm_wday)
    return “Get Your Ass to Church”;

  4. Original: Honor thy father and thy mother

    Code:

    pid_t PID = 0;
    PID = fork();

    if (PID == 0)
    pthread_yield();

  5. Original: Thou shalt not kill

    Code:

    ! kill(thyNewb.pid)

  6. Original: Thou shalt not commit adultery

    Code:

    std::tuple<ThyNeighbor> MyWife = new std::tuple<ThyNeighbor>();
    std::tuple<ThyNeighbor> YourWife = new std::tuple<ThyNeighbor>();
    ! MyWife.swap(YourWife);

  7. Original: Thou shalt not steal

    Code:

    pthread_t this_thread = pthread_self();
    !(pthread_setschedparam(this_thread, SCHED_FIFO, &params));
    !(void* allOfIt = malloc(137438953472));

  8. Original: Thou shalt not bear false witness against thy neighbour

    Code:

    bool bearFalseWitness(bool truth) { return !truth; }

    bool theTruth = true;

    if (theTruth != bearFalseWitness(theTruth)) goto HELL;

…Which leaves the last two:

  • Thou shalt not covet (neighbor’s house)
  • Thou shalt not covet (neighbor’s wife)

I’m having a hard time with those. Any readers out there have any good ideas as candidates? 🙂

Peter Bolton is the author of Blowing the Bridge: A Software Story and has also been known to be a grumpy bastard on occasion.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s