Do you feel like this when finishing challenges?

Hi all.

I’ve just finished the Exact Change challenge. Sometimes it feels like I’m just reaching a solution by brute forcing… I mean, before I start working on the solution, I have a very rough idea in my mind of the steps that I need to do to solve the challenge.

Then, when I think I’m finished, I see I get one or more red crosses… Then, I find myself adding/modifying the code until, finally, I get all greens… Is this how it’s supposed to be at the beginning?

Btw, my solution for the Exact Change challenge can be found here: https://repl.it/CkqW/0

Any feedback is much appreciated.

Thank you!

Similar, i’m not sure if it’s good or not either. But i’ve had a few times when everything worked perfectly, I was incredibly suspicious of those solutions and went back to re-read them.

Yes, that’s normal when starting out. Seldom does anything work the first time you test it. You have to go through the debugging process see how your code is behaving before you can account for all scenarios. That’s part of what these exercises are intended to teach. This is also part of the fun of programming. Good luck!

1 Like

Sometimes you’ve got to solve it awkwardly before you can solve it elegantly. You may not feel very satisfied with the way you solved the problem, but now you’ve got a proper grasp of the problem. You know you way around it. Now you can look at the whole thing and see opportunities for improvement. You can often grow more from re-doing problems than solving them in the first place.

3 Likes

This is how it’s supposed to be for pretty much ever. Your skills improve, and the tasks get more complex, but red/green/refactor is a totally valid (arguably preferable) approach to programming.

1 Like

Yup, a few weeks ago I had troubles with chaining for loops and if statements, now I have troubles solving more advanced algorithms and math problems. I went back and solved tic tac toe, twitch viewer and calculator after a week or two of practicing outside of fcc. After a bit more i’ll probably go to backend too. I never thought learning can be fun!

1 Like

This is exactly what it is like for me. I have just completed the basic JS challenges and a few of them really stumped me for quite a while. When I did finish them, I would search out others solutions and I found that others solved the same challenge in just a few lines when I needed to write triple what they did. It made my code look like Frankenstein’s monster.

But I say, “Thats MY monster, and it lives.” :slight_smile: