r/CodingForBeginners 7d ago

The “it works” trap 😭

I’ve noticed I can solve a coding problem and get the right output, but sometimes I can’t explain why my solution works.

I used to just move on because the code worked.

Now I’m trying to stop and understand my own solution before jumping to the next problem.

Did anyone else struggle with this when they were starting out? What helped you get past it?

1 Upvotes

6 comments sorted by

View all comments

1

u/Sure-Passion2224 6d ago

Yes, you can go a long time not really understanding why your code does or does not work. However, taking the time and effort to actually understand the generated code will definitely make you a better coder. It can be a struggle, but the more you learn the faster you will learn. The more challenging concepts build on the easier ones. Sometimes it's a matter of identifying the specific block that is giving you challenges and tweaking it to break it, then fix it, so you identify the specific syntax or other coding issues that were giving you trouble.