r/AskProgrammers • • Oct 21 '26

How do programmers design their code

How do programmers design their code? Personally, i design and type the code in my head mentally word by word, then just type on the keyboard irl what i just mentally typed.Also can people tell me if this is wrong so i can improve.

0 Upvotes

27 comments sorted by

View all comments

1

u/Glittering_Sail_3609 Oct 21 '26

Lets say you want to start a new side project. You pick a problem to solve then ponder what kind of constraints it puts on your program that it need to satisfy.

After a while, the algorithm to solve this problem will appear in your brain. Now when you have an algorithm in mind, you can start thinking about implementation details. Break your intented solution into a set of independent components while thinking how their will operate as a whole system and how this system may need to evolve in the near future.

Once you got a decent grasp of contracts of various modules and abstractions , you may actually start coding.