Should you look at the answer?

I have heard differing opinions on this. Some people say when you are stuck on a problem and the answer is available work on the problem for a while but if you get stuck and can’t figure it out go ahead and look at the answer. You are still learning by working through the problem with the answer. The other opinion is to hack away at the problem until you figure it out on your own. Which is the better way to learn and become a better developer?

This isn’t a direct response to your question, as I am more a proponent for not looking at others’ code when challenging myself, but I still thought it a little relevant when I came across it just now on Twitter:

1 Like