Productivity tips via code

I recently came up with the idea to represent common programmer hardships/pitfalls and their potential solutions in a language most natural for us coders: plain old CodeTM!


Here are some of the ideas I’ve gathered, which are written in C# (the language most natural to me) while leaving out some details and trying to keep it as close to generic pseudocode.

Tip 1:

while (currScope > idealScope) currScope--;

When feeling stuck in a project: Lower the scope until you see progress.

Tip 2:

foreach (var task in tasks)
    while (task.isTooBig())
    {
        var subTasks = task.SplitIntoSubTasks();
        tasks.AddRange(subTasks);
        tasks.Remove(task);
    }

When a task is too big, divide it into smaller chunks and work on those instead.

Tip 3:

if (motivation < interestInWorking)
{
    distractions = distractions.OrderBy(d => d.weight);
    
    while (distractions.Count > 0)
    {
        RemoveDistraction(distractions[0]);
        distractions.RemoveAt(0);
    }
}

If you can’t motivate yourself to work on your current project, reduce all distractions that get in your way one by one, sorted by the biggest to the smallest distraction.


P. S.: The code might be a bit lackluster and could probably be reduced to the core idea, but they should get the point across and should be understandable even when coming from other programming languages.


These lines of semi-pseudo-code could be printed on mugs or shirts if you like the message they convey (or tattooed on the forearm for those hardcore-nerds out there).


Feel free to give some feedback to these code-blocks, maybe come up with better ones, or share your own ideas.

September 28, 2023
Share