The two-minute rule for busy coders/learners

R
Python
Author

Vestin Hategekimana

Published

December 17, 2023

The two-minute rule for busy coders/learners

For busy readers
  • We generally have time on our hands, but what makes us feel short of time is the prioritization of our activities.

  • Starting to code is difficult, so the activity will be low on our priority list.

  • To make it easier to get started, you need to start with 2-5 minute sessions every week and gradually increase the importance of the activity.

  • To find out how to put this into practice and discover other tips, read the blog post.

Hey, aspiring coders! Let’s dive deeper into making coding a seamless part of your busy life. If you’re struggling to find time, the two-minute rule is your new best friend. It’s all about setting yourself up for success with quick, easy-to-start tasks. Let’s expand on this and give you some real actionable steps!

Note

As you read this article, please take note so that you do not need to come back too often. And be sure to apply everything right away!😁

The two-minute rule explained

The Two-Minute Rule is pretty straightforward: If a habit is hard to get into because of a lack of time, try to start slowly with short 2-minute sessions. This principle, a fusion of the Atomic habits philosophy and the Kaizen method, is perfect for building a coding habit. It’s about overcoming the inertia of starting by making the first step super easy. It is a practice that emphasizes continuous improvement through small, incremental changes in habits while getting rid of bad habits (which is not the focus today).

In concrete terms, you start by forging a habit by being regular for a small period of time, in our case 2 minutes every week. Then, when the habit is acquired, you can start to increase the duration and frequency according to what suits you best. You can start with 5 or 10 minutes if that’s not too much of a challenge.But don’t be greedy and hasty at first!

Indeed we are looking for long term results. Of course, nothing restrain you to have non-regular coding period outside of your new habit, but keep the regularity with this specific habit!

How to apply that in your coding habit? Follow this steps:

  1. Set clear objectives: Making a roadmap is event better! There are lots of different things to learn in coding. Not everything is necessary, and that’s why it’s important to set concrete, practical objectives. For example:

    • For Python it might be “Know how to create a complete machine learning workflow” rather than “Know how to do machine learning”.

    • For R it might be “Apply a Bayesian multilevel model in a research project on wage inequality” rather than “Know how to use Bayesian statistics”.

  2. Divide this/these objective(s) in multiple smaller steps: To avoid being overwhelmed by a huge goal, you need to break it down into smaller, chronological and measurable objectives. If you’re having trouble doing this, there are plenty of roadmap infographics on the Internet, and in the worst case, ask Chat-GPT or another model to do it for you. Going back to the previous examples:

    • For Python it could be:

      1. “Import data”

      2. “Clean data”

      3. “Apply random forest model”

      4. “Compare performance of different models”

      5. “Make predictions”

      6. “Export model”…

    • For R it could be:

      1. “Select appropriate data”

      2. “Collect data”

      3. “Perform descriptive analysis”

      4. “Specify appropriate priors”

      5. “Optimize the model”

      6. “Create regression tables”…

  3. Set a precise time: To anchor a good habit, it’s important to rely on regularity rather than effort. Start by setting a simple rhythm (in this case, 2 minutes) and, above all, a precise context. For example: “Every Friday at 6 p.m. on my table in my room, I’m going to learn to code, for 2 minutes”. You can increase the length and frequency of these sessions as you get used to them. There’s no point in starting intensively - it’s the regularity that counts.

  4. Identify obstacles and set up a coding zone: See the next section for more details!

Identifying obstacles and setting up your coding zone

Think about what stops you from coding. Here are some classical examples:

  • Distraction in your PC/smartphone?

  • Is it setting up your environment?

  • Finding the right resources?

  • Lack of roadmap or precise steps?

  • Starting take too much time (more than 2 minutes)?

  • Forgetting everything each time?

  • Non regularity?

Write these down and tackle them!

The best way to resolve most of the problems is to create an environment that invites you to code and get started fast. Here’s how:

  1. Eliminate distractions: Turn off non-essential notifications and put your smartphone aside. You have little time to focus on your work, don’t waste it!
  2. Dedicated space: Even if it’s just a corner of your desk, make it your “coding zone.”
    1. Projects: On your computer, use projects which are dedicated environement (generally a folder) in which you find all the scripts and tools you need to start coding. For instance, Rstudio and VS code have their dedicated way to organise project.
    2. Keep things tidy: Spend time organizing your projects and your code in a clean way. Every minute you spend getting your project clean will be hours of work you’ll save yourself in the future. What’s more, your project will become a great example for your future works, and therefore a golden resource!
  3. Keep your tools handy: Have your laptop, charger, and any books or resources you need within reach.
    1. Bookmark resources: Keep tabs open with coding websites or tutorials you’re following to check anything you need. Ai tools are also ressources, but limit their use (you risk becoming dependent and learning nothing).
    2. Take notes as you learn: The best ressources are the one you make. Keep a file open (Markdown, Word document, etc.) to note everything useful to help you remember tips/tricks and to write down steps to get started fast (you rarely can remember everything the first time).
    3. Look for productivity tools: Many code editor like RStudio or VS Code have powerfull extensions. I highly recommand TODO extensions on both RStudio and VS Code, since they let you start right away with specific tasks on your code and help you navigate them.
  4. Look for accountability: It’s no easy task to forge a new habit and stick to it. Often it’s events beyond our control that prevent us from sticking to them. That’s why it’s important to think ahead, to make it difficult to get out of these habits and easy to get in. The most important thing is not to blame ourselves, but to get back into the swing of things as soon as possible:
    1. Plan B: Not only do you need to choose a good time that won’t be disrupted, but you also need to anticipate how you can make up for any unforeseen circumstances. You need to plan ahead for a Plan B, which is another time when the session can be rescheduled. It’s not enough to “make up the time” at the next session; what counts is regularity, not time spent.
    2. Plan C: There are extreme cases where it’s literally impossible to continue the activity as desired. In such cases, coding is no longer possible (prolonged absence, lost computer, broken hand, etc.). If possible, you need to plan ahead for a viable alternative to keep up the pace. This doesn’t necessarily mean coding. The following section gives a list of things you can do.
    3. Working with colleagues: The best way to stay accountable without putting too much blame or pressure on yourself is to join a work group that has set itself a goal of regularity (it doesn’t have to be the same subject). For example, you can organize regular face-to-face or online meetings. During these meetings, everyone works on their personal project. Or you can simply share your progress without the need for meetings. Whatever suits you!

All of the above may seem like big challenges, especially if you’re not familiar with them. But don’t worry, you don’t have to apply them all at once. I’ve arranged them in order of importance. Concentrate on one element at a time until it becomes natural for you. Then you can concentrate on the next element. Since eliminating distractions and finding a dedicated place to work are required, you can start with setting up your project, then move on to keeping your work area clean, then move on to making resources available, and so on. See? A piece of cake!

Coding tasks by time

Ok, we have everyting to start. So what now? What can you possibly do in two, five our ten minutes? Also what about the extrem cases when we can’t possibly code? Let’s break down some coding activities:

Note: activities that can be done whith a smartphone are marked with a (📱) and activities tha can be done without coding are marked with a (). Also, when no technology is needed it is marked with a (✏️).

  • Two- or five-minute tasks:

    • Do an online coding exercise (here is a list of good platforms) 📱

    • Read a tutorial/documentation/book and take note 📱✅✏️

    • Drill a simple script to memorize it

    • Set up a working directory in the computer✅

    • Organise a project in smaller steps✅

    • Write a comment/TODO in the code explaining your next steps.

    • Read a code snippet and type it out.

    • Bookmark a tutorial for your next session. 📱✅

    • Set new goals✅✏️

  • Ten- or five-minute tasks:

    • All the previous tasks

    • Start a new project (divided in multiple sessions)

    • Try a new library/package

    • Debug code or find solutions on internet

    • Follow a short YouTube tutorial (it is better to code in the same time) 📱✅

    • Organise/clean the project ✅

  • Thirty-Minute or more tasks:

    • All the previous tasks

    • Build a small project

    • Work through longer tutorials (you should definitely code along)

    • Learn new coding tricks 📱

    • Learn other coding tools (GitHub for instance)

    • Learn new languages (latex, regex, html, etc.)

  • When coding is impossible:

    • Organize your roadmap 📱✅✏️

    • Discuss about programming 📱✅✏️

    • Compile new resources 📱✅✏️

Start now, start small

We’ve finished the main part of the tutorial, so you can stop here. If you’re still not sure how to get started, in the next section we present a concrete example.

Important

Before you move on, choose a two-minute task from this list and do it. Right now (or plan it for later). It’s all about building momentum!

Final example

Now we have everything we need to start these new habits. Let’s take the example of Sandiya, a geographer who wants to learn how to use R for a future article. The problem is that she knows nothing about R. So she decides to use the two-minute principle.

Sandiya’s journey: mastering R with the two-minute rule

Once upon a time in the bustling city, there was a geographer named Sandiya. Passionate about urbanism, she had a dream: to create a detailed map of urban car density using geodata from parking places. But there was a catch – she didn’t know R, the programming language perfect for this task.

Step 1: Defining the goal

Sandiya’s project was clear: analyze car density variability in various parking places over time. But to do this, she needed to learn R, master data analysis, understand web scraping, and get a grip on geospatial analysis.

Step 2: Crafting a roadmap

After fruitful discussions and online research, Sandiya outlined her learning path:

  1. Basics of R

  2. Data Analysis Skills

  3. Web Scraping Knowledge

  4. Geospatial Analysis with R

With her roadmap in hand, she decided to start small, applying the Two-Minute Rule.

Step 3: Setting the habit

Every Tuesday at 4 pm, Sandiya’s living room transformed into her learning zone. She started with just two minutes of R practice and gradually increased her time.

Step 4: The initial strides

In her first session, Sandiya installed R and RStudio, a small but crucial step. The following week, she began online exercises on W3Schools, steadily progressing through them. It was a wise choice, since the website is completly free, doesn’t require an account and has tutorials on R.

Step 5: Expanding the learning schedule

Two months in, Sandiya was already diving into “R for Data Science” (a free online book to learn R). She added Thursdays at 4 pm to her schedule, now feeling more confident and eager to learn. She was already working 30 minutes per session.

Step 6: Gaining confidence

After another two months, she had honed her data analysis skills. Tackling a data analysis tutorial, she replicated the examples, cementing her understanding.

Step 7: Diving into web scraping

Sandiya then turned to YouTube videos and blog posts to learn web scraping. She meticulously took notes, starting to collect her needed data. She needed more time, so she decided to work at least one hour per session.

Step 8: Embracing geospatial analysis

Simultaneously, she delved into a Bookdown on geospatial analysis in R, replicating examples and building her skills.

Step 9: Six months of transformation

Six months from her humble two-minute beginnings, Sandiya was working six hours weekly on R (three hours each on Tuesday and Thursday) and had reached an advanced level. She was able to submit her paper for publication.

Step 10: Flexibility and persistence

Not every week was perfect. Sometimes, life intervened, and Sandiya rescheduled her Tuesday sessions to Saturday mornings. But she persisted.

Step 11: Eyeing a new challenge

Now, comfortably adept at R and with a regular habit firmly in place, Sandiya began contemplating learning Python, using the same effective, gradual method.

Sandiya’s story is a testament to the power of small, consistent steps. Starting with just two minutes of focused time, she transformed her skill set and realized her dream. Her journey, marked by clear goals, a structured roadmap, and adaptable persistence, is an inspiring blueprint for anyone looking to embark on a similar path. Remember, every big accomplishment starts with one small step. Just like Sandiya, you too can achieve your learning goals, one small, focused session at a time. 🌟💻🗺️


Remember, coding doesn’t have to be a daunting time-sink. With the Two-Minute Rule, you’re not just learning to code; you’re integrating it into your life in manageable, enjoyable pieces. Keep it up, and watch how these minutes add up to significant progress. Happy coding, friends! 🚀💻✨