Sefism early access is open for X and Instagram followers and university students.Get early access
Confidence and consistency

How do I stay consistent when learning to code?

Tauseef Fayyaz

Answered by Tauseef Fayyaz

Asked 6 timesUpdated 15 Sept 2026
Short answer

Consistency is not a personality trait. It comes from making the daily unit so small you cannot skip it, knowing exactly what the next session is before it starts, and measuring output rather than hours. Restart small after a break instead of waiting to feel motivated again.

What people tell me

I start learning with a lot of energy, follow a roadmap for a week or two, and then stop. At one point I did not open my laptop for a month. I cannot sit for hours like other people seem to, and every time I reach a harder topic I feel stuck and scared by how much is still left to learn. I have made plans many times but cannot follow them for long.

A composite of the messages behind this question, with personal details left out.

Key takeaways

  • Shrink the daily unit until skipping it feels silly: 25 minutes and one concrete task.
  • End every session by writing down the exact first step of the next one.
  • Track output (problems solved, features shipped, notes written), not hours sat at a desk.
  • After a break, restart with something you already know, not the topic that made you stop.
  • Accountability from a partner, a community or a mentor beats willpower for most people.

You are not lazy, the plan is shaped wrong

Six people have sent me some version of this, and the stories are remarkably similar. One had not touched their laptop in a month after a topic felt too big. One asked how many hours a day they should study but admitted that sitting for hours was the hard part. An experienced developer had written a roadmap several times and abandoned it every time.

Almost nobody in these messages lacked ability. What they had in common was a plan built for an imaginary version of themselves: someone with unlimited focus, no bad days and no fear of the next chapter. When the real person could not keep up with that plan, they concluded the problem was them.

Consistency is a design problem. Here is how to design for it.

Why plans collapse

What happensWhat it feels likeWhat is actually going on
Week one goes brilliantly, week three stops"I lost motivation"The daily target was set on a high-energy day and is too big for a normal one
You open the laptop and scroll instead"I cannot focus"The next step is vague, so starting costs a decision you do not have energy for
A hard topic stalls everything"This is too much for me"You hit the first real difficulty and read it as a verdict on your ability
A missed day becomes a missed month"I have ruined it"All-or-nothing thinking: one gap turns into a reason to stop
You keep switching resources"I have not found the right course"Shopping for resources feels like progress and avoids the hard part
The roadmap feels endless"There is always more to learn"No finish line was defined, so you can never feel done

Each row has a fix, and none of them require more willpower.

Seven fixes that work

1. Make the daily unit tiny

Commit to 25 minutes and one concrete task. Solve one problem. Write one function. Read one section and summarise it in five lines. If you do more, great, but the promise is only the small unit.

This works because the hardest part of any session is starting, and a small commitment makes starting cheap. Two focused hours spread across a day often achieve more than a four-hour block you dread.

2. Never end a session without the next first step

The last two minutes of every session: write the exact first thing you will do next time. Not "learn collections", but "open the notes, write a program that stores ten names in an ArrayList and removes duplicates using a HashSet". Tomorrow you sit down and there is nothing to decide.

3. Measure output, not hours

Hours are an input and they reward sitting, not learning. Track things you produced:

  • Problems solved and reviewed
  • Small programs or features that run
  • One-paragraph explanations in your own words
  • Commits pushed

A simple weekly tally is enough. Seeing the number grow is quietly motivating in a way that "studied 3 hours" never is.

4. Break frightening topics into visible pieces

When a topic feels endless, list its pieces on paper. A language's collections framework, for example, is really: lists, sets, maps, queues, iteration, sorting, and when to choose which. Seven pieces, not an ocean. Cross them off. Learning never truly ends, but a topic does.

5. Restart small after a break

If you have been away for days or weeks, do not return to the exact topic that made you stop. Spend the first two sessions on something you already know: rebuild a small program, revise a chapter you liked. Rebuilding momentum comes before resuming difficulty.

6. Protect the time from distraction

Phone in another room. One browser window. Social apps logged out during study blocks. There is no point spending two hours on a topic and then two more on reels; attention is the resource you are actually spending.

7. Borrow accountability

Most people who stay consistent are not using willpower. They have a study partner, a community where they post progress, a mentor they report to, or a public log of what they learned. If self-driven learning keeps failing, stop fighting it and add another person to the system.

A four-week reset plan

Use this if you are currently stuck or coming back after a gap.

WeekDaily commitmentGoal for the weekCheck at the end
125 minutes, 5 daysRebuild the habit with material you already knowDid I show up 5 times? Output does not matter yet
225 to 40 minutes, 5 daysStart the next real topic, broken into piecesPieces listed and first two crossed off
340 minutes, 5 days plus one longer weekend sessionBuild one small thing using the new topicIt runs, even if ugly
4Keep week 3, add one review sessionExplain what you learned to someone or in a short postCould I teach the basics of it?

Missing a day is allowed. Missing two in a row is the signal to shrink the unit again, not to quit.

About "how many hours should I study?"

It depends on your starting point and deadline, but for most students a steady two to three focused hours on weekdays and a little more at weekends is plenty for serious progress over a couple of months. If you cannot sit that long yet, start at 25 minutes and grow it. Consistent short sessions beat occasional marathons every time.

When it is more than a habit problem

If you feel low most days, have lost interest in things you used to enjoy, or the thought of studying brings real distress rather than ordinary reluctance, talk to someone you trust, and consider a counsellor or doctor. That is not a failure of discipline, and no study technique replaces proper support.

If you are still stuck

The longer post on what to do when you are stuck learning to code goes deeper into getting unstuck on a specific problem. For accountability, join the Sefism Discord and post what you did each day. And if you want a plan built around your actual week, book a free 1:1 session.

Was this answer helpful?

Ask your own

Your situation is not quite this one?

Members get written answers to their own questions, a roadmap built for them and feedback on their projects. Early access is open to X and Instagram followers and university students. Prefer to talk? A free call works too.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

Follow along

New writing, resources and project ideas land here first.

More questions people ask

All questions