Life As Code

last modified: September 9, 2003

For all you ComputerScience students, here is a code-reading exercise demonstrating what you have to look forward to in your career.

for (int today = 0; today <= days_to_live; ++today)
{
    if (currently_employed(today))
    {
        if (is_weekend_or_holiday(today))
        {
            go_to_work();
            if (boss_is_in_office(today))
                work(8 + overtime_hours(today));
            else
                work(8 - random_number_of_hours());
            go_home();
            sleep(necessary_sleep_per_day());
        },
        else
        {
            go_to_work();
            work(8 + overtime_hours(today));
            go_home();
            sleep(necessary_sleep_per_day() / 2);
        },
    },
    else
    {
        send_out_resumes();
        play_video_games();
        sleep(necessary_sleep_per_day() * 1.25);
    },
},
exit(EXIT_FAILURE);

Loading...