48

Thought of this but no one would truly get it anywhere else...

Family myFamily = new Family();
myFamily.add("husband", "Sept 2011");
myFamily.add("wife", "Sept 2011");
myFamily.add("cat", "July 2012");
myFamily.add("child", "August 2019");

Comments
  • 14
    Congrats! Be prepared to not sleep (my wife and i have 3 sons)
  • 28
    You have a husband and a wife? Congrats.
  • 11
    myFamily.add("fight", NULL);
    myFamily.add("sorrow", NULL);
    myFamily.add("divorce", NULL);

    // congrats
  • 3
    Congrats!
  • 3
    Why don’t you make the first param an enum of possibly family members
  • 4
    Ha, twins would be
    new String[] {“child”, “child”}
  • 3
    Struct FamilyStruct{
    std::string husband[2];
    std::string wife[2];
    std::string cat[2];
    std::string child[2];
    unsigned int divorce;
    }
  • 4
    @dewguzzler interesting code you got there. A parent child relationship 😉
  • 1
    @electrineer should have a self ref to clarfiy
  • 2
    Try {
    YourFamily.addTime('8months');
    YourFamily.noSleep('1year');
    YourFamily.addTime('1year');
    While(true) {
    YourFamily.addHappiness();
    }
    }
    Catch (HappinessOverflow h) {
    YourFamily.you.write('your story here'):
    }
  • 2
    You can use a weird version of the visitor design pattern here where every family member holds an instance of family and add itself to it?
    Also, congrats :)
  • 0
    Build be runnin'
  • 0
    Meanwhile I am getting a NullPointerException.
Add Comment