494

Manager: Write a function to get tomorrow's date.

Kids:

int getTomorrowsDate() {
return getCurrentDate() + 1;
}

Legends:

int getTomorrowsDate() {
sleep(1000*60*60*24);
return getCurrentDate();
}

Comments
  • 58
    But when the function finally returns the date, it isn't the date of tomorrow anymore but the date of today, is it?🤔🤔

    (Legendary function)
  • 18
    Yesterday's date is a proper mind bender!
  • 49
    @Johnnyrook Simple, pass a negative integer to sleep, then the function will execute before you write the code.
  • 4
    Am I doing this right?

    int getTomorrowsDate(int isItTomorrowYet = 0) {
    if (isItTomorrowYet < 1000*60*60*24) {
    sleep(1);
    return getTomorrowsDate(++isItTomorrowYet);
    } else {
    return getCurrentDate();
    }
    }
  • 15
    You forgot the sleep(-1000*60*60*24*) to return to where you started.
  • 7
    If you were a real Dev , you would procrastinate the work till tomorrow and display “today’s “ date 😂
  • 2
    @kolaente Well he never said it had to be a quick function.
  • 0
    Now that deserves a ++
  • 0
    @Shodan Yeah but why though ?
  • 0
    @Ranguna Exactly, "but why?". The joke in this rant is about roundabout ways to do simple things. I just tried to amplify that.
  • 0
    @Shodan Hahaha right !
  • 1
    Me:

    int getTommorowsDate() {
    return getHotGirlsPhoneNumber();
    }
  • 0
    @Shodan let's just assume the stack is big enough! ;) #pushtoproduction
  • 2
    @bittersweet At the expense of opening a black hole
Add Comment