I program in C++. Sometimes there are 1000 ways to do something, and depending on the inspiration/energy, etc of the moment, I can take “the right one” or not, and spend 10 minutes or three days to solve a problem or find a solution or do a task for the boss.
When you are programming, how do you deal with this “open” situations? Use your intuition? Prefer to plan a lot before?
Thanks a lot
Repeat until I have the functionality I need to actually solve the problem.
Now check if the code is clean enough. Most of the time it won’t. In that case, refactor until it is clean.
Clean enough means: Either considerably cleaner then the average piece of code in the project, or as clean as I am able to write it. Whatever is reached earlier.
Ok I have to admit, this is atleast how I try to write my code.
Choosing the solution by testability as a side effect prefers the well designed solutions.