r/learnprogramming • • 16m ago

Tutorial How can I become good at problem solving?

After getting a task some programmers just starting writing the code, while writing the code they understands all the logic behind that...how can i achieve that level of skill?

2 Upvotes

3 comments sorted by

•

u/grantrules 11m ago

How do people become good at playing piano? How do people become good at hitting a baseball? How do people become good at tapdancing? How do people become good at writing poetry?

Practice.

https://adventofcode.com/

•

u/SnugglyCoderGuy 8m ago

Practice.

The number one rule of problem solving is if you can't solve the problem in front of you then break it up into smaller problems. Keep breaking the problems up until you do get a problem you can solve, then solve it. Do this recursively and eventually you solve enough problems that you've solved your original problem.

•

u/JohnsTech_dev 2m ago

a lot of those people who just start typing are rewriting stuff they've already done 20 times, so the logic looks free to them. it isnt really. what helped me was writing the input and the expected output of the function as a comment first, then one tiny example by hand on paper. if i cant do the example by hand i have no business writing the code yet. after a few months you start seeing the same shapes, like two pointers or a lookup table, and it gets quicker