writing the code twice

is it only alright to write the code twice?
i mean when i start a new project i had to write the whole project(not the 100% of the project) within main function, after that im going to rewrite the whole code and turn it into cleaner,efficient code (object oriented) does this mean im not good at writing on the spot?
Last edited on
There is no need.
After a long time of learning when you feel your C++ code is much more advanced and more professional, you might want to rewrite some old piece of code to prove that you have actually grown.
closed account (1vRz3TCk)
elay,

As you gain experience you will start to write your code in a form that is more efficient and cleaner. However you will probably always be refactoring, it is not a bad thing.

https://en.wikipedia.org/wiki/Code_refactoring
We all start writing code in main. The great thing about programming is as you grow so does your skill and time management.

When you start writing functions instead of using main for everything, you can re-use code you have already written and make apps much quicker.

Enjoy the journey!
Topic archived. No new replies allowed.