
Ask HN: How to improve problem solving and reasoning skills - ayEl
As a CS student in my final year, I still have difficulties solving what I would characterise as relatively easy problems, I usually just start writing code as soon as I read the problem and just keep modifying it and adding stuff to it, I have tried writing algorithms on paper a few times but I haven&#x27;t noticed any difference really since I don&#x27;t really &quot;think&#x2F;reason&quot; about what I&#x27;m writing, I don&#x27;t know if my description is relatable but that&#x27;s how it feels, it&#x27;s more like me writing whatever pops in my mind rather than logically trying to solve the problem.<p>So to circle back to my question, how would you go about dealing with this?
======
olikas
Solving a problem by experimenting is rarely useful. I'd call it accidental
solution. You can improve by doing it the hard way. Do not write down anything
unless you understand why you do it. As a test, try to answer the following
question: "Why will it work?" It is also useful to think about other solutions
before committing to one. Try to come up with pros and cons.

You can improve your reasoning skills by fixing bugs. First observe the bug,
try to make a hypothesis. Try to support it by reading the code (do not run
it, don't use a debugger at this point). Once you have a plan, find evidence
that support your theory. Once your theory is right, find a solution, and
answer the question "why".

It will take time, but you will improve over time. For me, the key is
patience.

~~~
ayEl
Thanks for your advice, I'll experiment with this method.

And yeah that's actually how I used to find solutions: by accident. I just
keep tweaking the code and running it until it gives the solution I want.

I never really considered this a problem, but I'm glad I'm aware of it now,
it's better late than never.

------
jibalt
Have you thought about what sort of response your question might produce?

As an exercise, give your best shot at answering your own question.

~~~
ayEl
Yeah, I thought it might produce some good suggestions that worked for other
people and that I could try.

Hopefully people who actually have something constructive to share will see
this question too.

