The Relationship Between Hubris and Sloth in PHP

WordPress has kindly informed me that I’ve reached 50 moderately absurd posts. I will now set a public target of 100 posts this year – just so that I can miss it and be publicly humiliated. 🙂

As I recently commented to a friend, I only post in accordance with the following programatic statement:

// PHP Blog Posting if/else statement.
if (Hubris > Sloth) {
    Write New Blog Post ;
}else{
    Drink beer;
}

Advertisements

5 thoughts on “The Relationship Between Hubris and Sloth in PHP

  1. Phil

    FTFY


    class Tim extends Person {

    public function __construct() {
    $this->personId=85105263012345129387423001993;
    $this->hubris=Life::getHubrisValueForPerson($this->personId)*2;
    $this->sloth=Life::getSlothValueForPerson($this->personId);
    }

    public function delusionsOfGrandeur() {
    // PHP Blog Posting if/else statement.
    if ($this->hubris > $this->sloth) {
    $post=new Post($blog,$contents);
    $post->write();
    } else {
    self::drink(new Beer());
    }
    }
    }

    The best part is that now the beer just appears; I’ll implement a function that defines what kind of beer it is later, so for now it’s a bit of pot luck (or the beer is empty /sadface ).

    In my original implementation, only the Tim subclass had sloth and hubris attributes, however I quickly realised these would be more appropriate to be defined in the parent class.

    (Boy, that quickly got out of hand)

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s