thumbnail
Mohamed Amine Terbah

Do You Plan Ahead or Figure out Programs as You Are Writing Them?

May 28, 2025
Anita Olsen
Anita Olsen Subscriber

Posted on

Do You Plan Ahead or Figure out Programs as You Are Writing Them?

I have been wondering if I should plan ahead everything I code in advance since I tend to figure out a program as I go. When I do anything frontend, I plan how I want the CSS image or the web page to look like before I even start to code though but apart from that, I pretty much jump into it right away. I admit it would probably have saved me some time if I had just sat back and planned out the desired outcome more before I started coding.

Here is an interesting excerpt on the topic from Hackers and Painters by Paul Graham:

For example, I was taught in college that one ought to figure out a program completely on paper before even going near a computer. I found that I did not program this way. I found that I liked to program sitting in front of a computer, not a piece of paper. Worse still, instead of patiently writing out a complete program and assuring myself it was correct, I tended to just spew out code that was hopelessly broken, and gradually beat it into shape. Debugging, I was taught, was a kind of final pass where you caught typos and oversights. The way I worked, it seemed like programming consisted of debugging.
For a long time I felt bad about this, just as I once felt bad that I didn't hold my pencil the way they taught me to in elementary school. If I had only looked over at the other makers, the painters or the architects, I would have realized that there was a name for what I was doing: sketching. As far as I can tell, the way they taught me to program in college was all wrong. You should figure out programs as you're writing them, just as writers and painters and architects do.

Do you follow a particular structure while you code? Do you plan ahead or figure out programs as you are writing them?

Top comments (8)

pic
Submit Preview
Collapse Expand
 
linkbenjamin profile image
Ben Link
Dropdown menu

My answer is... YES!

It really depends on context. Am I doing something exploratory, where I don't necessarily know what the end product is going to look like? Then code as you go. You can always come back and refactor later, but for now, focus on getting things to work.

If I'm building something and I know what it ought to look like, then I should try to minimize the refactoring required - take time to design and think through the structure ahead of time.

This is the one way that I see Software Engineering as being different from other types of Engineering... we don't always have to know the end goal before we start building.

Like comment: Like comment: 3 Like Comment button
Collapse Expand
 
nevodavid profile image
Nevo David
Dropdown menu

pretty cool to see someone admit they just hack through it too - honestly i always end up making tweaks on the fly anyway. you think figuring stuff out as you go can actually lead to better ideas, or does it just slow things down?

Like comment: Like comment: 2 Like Comment button
Collapse Expand
 
anitaolsen profile image
Anita Olsen
Dropdown menu

Hehe 😁

I have no idea. One should think that a little bit of planning would save some time but I do not know.

Like comment: Like comment: 1 Like Comment button
Collapse Expand
 
raz_devra profile image
Raz Devra
Dropdown menu

for me....

Here’s the workflow I follow:

Use ChatGPT for brainstorming ideas — the what, how, and why.

Start wireframing with pen and paper as soon as I have a rough concept.

Move to Uizard.ai (Figma isn’t my thing) and recreate the wireframe digitally. Then I use Uizard’s AI to enhance it.

Finally, I follow that UI and start writing the actual code.

Like comment: Like comment: 2 Like Comment button
Collapse Expand
 
samuraix13 profile image
SamuraiX[13~]
Dropdown menu

Honestly it's hard for me to imagine all the things I know I'm going to want in my project and how I'm going to do them and it's even harder for me to stick to a static plan, so I mostly start my project with very basic image I had in my head and adopt it as time passes, though this approach of mine is not really that much of a nice one when it's about something like a game dev project, for example when I'm working on a development board, I have a basic image in my head about stuff I'm going to do and I figure how I'm gonna do them and how I can add futures I like when I'm sitting in front of my monitor, but when it's a project like developing a game, since nearly each decision effects over all game quality big time, I wouldn't really freestyle much in situations like that

Like comment: Like comment: 3 Like Comment button
Collapse Expand
 
syakirurahman profile image
Syakir
Dropdown menu

Plan ahead, of course.

Especially we have AI now.
I usually brainstorm the idea with chatgpt first. Then go deeper with framework choices, folder structure and best practices.

Like comment: Like comment: 3 Like Comment button
Collapse Expand
 
wraith profile image
Jake Lundberg
Dropdown menu

as with all things, it depends.

if I’m working on something small, it’s time to hack and slash my way through it. but if it’s remotely complex or I’m working with others, there’s at least 1 flow chart and some breakdown of work (usually using GitHub’s product management tools).

10 minutes of planning up front can save hours of work later

Like comment: Like comment: Like Comment button
Collapse Expand
 
dotallio profile image
Dotallio
Dropdown menu

Totally relate to planning out UI but figuring out the rest as I go - sketching code feels the most natural for me too.
Curious, is there any part you always plan out before touching the keyboard?

Like comment: Like comment: 1 Like Comment button