Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jericopulvera's avatar

How to code continuously?

When developing a website I often find myself staring in the monitor thinking on what should I do next for a couple of minutes, and sometimes at the middle of doing a functionality and I got distracted for a bit I would lose track on what I'm doing and keep on thinking what should I do next.

  • can you give me some tips on what should I do to be more productive?
0 likes
6 replies
SaeedPrez's avatar

Learn test driven development (TDD).. you create a test first of how you expect your application/function to work, then you have to write the code to make that test pass.. And later when you make changes in your application, you can run all tests to make sure everything is still behaving as expected..

It's really a game changer

2 likes
bobbybouwmann's avatar

Make the features smaller. It sounds to me that your features are way too big to handle at once. Try to keep them ultra small. Maybe you can do 300 features a day, but you can then finish them one by one which gives you a really good feeling ;)

1 like
jlrdw's avatar

Nothing like a pencil and paper to draw out what you expect a screen for the user to look like especially in a business application.

2 likes
barmang's avatar

First you gotta plan what you want to work on. That can and should happen before you're at the computer. Once you start coding, you listen to the the same album over and over - eventually it becomes background noise. Or you can look into the pomodoro technique https://en.wikipedia.org/wiki/Pomodoro_Technique

1 like
youkineko's avatar
Level 27

Try to not code continuously, but take a break once in a while.

You should follow @jlrdw and @bobbybouwmann advices. Using pen and paper to sketch ideas is great. Splitting big features into a smaller ones will help you with returning back to work after a break.

For example lets take a simple login form with CSS and backend implementation. I usually split it in the following tasks:

  • Create simple html markup. (Just bare bone that I can open in the browser and see couple of fields and a button)
  • Create simple backend to handle the form submission. (At this step I usually don't bother with validation)
  • Create simple styles. (Adding some CSS to the form to make it look good, but not overdoing it and I'm not testing the full browser stack for compatibility. Yet.)
  • If the form should AJAX, I'll start implementing it now, but again as simple as possible.
  • Then revisit every step and improve the code.

The main idea is to have a working code at the end of every step. Even if the code isn't 100% working (The form is not logging anyone, but you can see it). This way if I got distracted or take a break, I can easily see what I was doing and continue from with the next step.

Keeping a simple TODO is also helpful. I usually use a simple .txt file with all the steps listed. And I add or remove points from the list depending of if the step is done or something new came up.

Please or to participate in this conversation.