4 ms·
Then you need to do a better job of running the code in your head and understanding what it does. Code that is 'written by debugger' is easily recognizable in
by justin_vanw 11y ago
Then you need to do a better job of running the code in your head and understanding what it does. Code that is 'written by debugger' is easily recognizable in that it is crappy in pretty specific ways.
If you often have to run your code so that you can verify that it is doing what you thought it would do, you don't have any idea what is going on and it's going to be a disaster.
Of course you need to run it to catch mistakes that anybody will make, but not to check that the code does what you think it will do.
For example, in some language you have my_list.sort() method. What does this do to the list? Does it sort it in place? Does this lock the list from other changes? Will concurrent changes to the list corrupt it? What is the expected runtime of this? If the list contains strings, how are they sorted? By unicode code point? By binary utf-8 encoded value? Randomly?
You should just know all those answers in whatever environment you are working in. If you don't you should study up on it. Trying to get a project finished by repeated guess and check is going to take an eternity and you are going to do a poor job.