Apply solution of problem in code

Hi everyone

I make a post here because I have little teorethic problem with topic called ,Implement new solution to fix existing problem in code".

For example I have problem in code and propably right solution to implement but I’m not sure how should i do this.

A) write solution a few times to understand and learn how it works

b) Try to understand mechanism and change your code with this solution to everything go fine.

What should I choose

choose whatever is going to fix the code

Is sometimes that situation where You just look at the code/ example and it’s enought to understand what should You do in your code or Better idea little bit practise this ?

I don’t understand your question

You should definitely understand your code before using it.

It sounds like you are copying code and what to know if you should:

A) Manually write it out in the hope you will better understand the code by doing so.

B) Read and understand the code first and then write it all from scratch using your own code with that knowledge.

I would say B in almost all cases.