Written as Code: The Ten Commandments

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

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


    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


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

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


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

  4. Original: Honor thy father and thy mother


    pid_t PID = 0;
    PID = fork();

    if (PID == 0)

  5. Original: Thou shalt not kill


    ! kill(thyNewb.pid)

  6. Original: Thou shalt not commit adultery


    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


    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


    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