What do you think about "don't look at the code" rule for challenges?

What do you think about "don't look at the code" rule for challenges?

What i tend to do most is break the problem down and then go googling for specific elements that I don’t understand from the mdn examples. Half the time you run in to stack overflow answers or blog posts that are exactly the same as the challenge you are facing so it’s almost impossible not to see the answer if your looking hard enough. As long as i take the time to understand and type it, then I’m not too worried, as you say.



Right, I think I used the wrong terms. If “coding problem” is a whole program, then yes I figure most of that out by myself and I enjoy doing that. I was thinking more like “coding problem” as in “what is the most efficient way to randomize an array.” For that kind of stuff I’ve never seen the need to reinvent the wheel.



I’ve been mulling this over for myself recently…I’ve been thinking about the No Repeats algortihm, and I’ve been wondering whether I should just take a permutation algorithm from Stack Overflow, or try to code the actual permutation part myself. Once the permutation part is out the way, the rest of the algorithm seems trivial - but taking the SO permutation function feels like cheating since that is the guts of the whole challenge really.

My maths isn’t up to the stage yet where doing the permutation myself is on the cards…so I’ve just let it sit there un-attempted until I can really be bothered to dig into it.

There’s no sense of urgency though…I’m happy learning other things for now :slight_smile:

1 Like


The very moment that you look at the code is the moment you lose the value of learning. The problem was so that you will take the time to research and study on how to do the problem. Asking in the forums or the chat is okay to the extent that they will just guide you to finish a problem, but if you just look at the code or ask the code from others, it is unlikely that you will learn.

They made that rule for the benefit of everyone. As a self-paced learning website, honesty to self is one of the most important. You can finish this course without learning anything new, or you can become a great developer if you are honest in answering each on

With that, if you are struggling with a problem, review the exercises you have done and read some documentation of the programming language. Answering the problems on your own or asking for help when you struggle is the way for you to learn.



I was feeling the same thing about the No Repeats challenge. The way I got around it was to hit Wikipedia and read some of the pseudo-code around different well accepted permutation finders. Once I had an idea how they were thinking, I was able to implement my own which is certainly less efficient than the generally accepted solutions but is mine and gets the job done.

I also left with a slightly higher level of math. :slight_smile:

In response to the original question, I have looked at the example code in each project, but only after submitting mine. I’m not sure whether I retained any of the ‘aha’ moments I had when doing so, but I’ve enjoyed it and certainly don’t regret it. I never looked at it to help me solve problems, in part because of the rule and in part because I’ve always found the resources I needed elsewhere.

1 Like


Personally, I agree with the rule and am of the opinion that it should be violated only if all other options have been exhausted (SEARCH-ASK) or if once a challenge has been submitted you want to compare your solution to that of other campers.

Something I noticed early on in myself is the desire to finish quickly was too much of a driving force. I’ve noticed this in others through their forum comments as well. Learning is hard work and quite often comes into conflict with the desire to finish and move on. However, taking the time to search and ask will have a bigger payoff down the road.

I think there should be one additional component added to SEARCH-ASK…REFLECT. This is where comparing your solution to that of others is very appropriate IMHO. Right or wrong I’ve always thought of REFLECT as being synoymous with ‘continuous improvement’.

Remember, it’s not about how quickly you arrive at a solution - it’s about what you learn, retain, and improve.



For me, only after I submit a passing solution do I review the algorithm solutions and others’ code. I want to check to see if I am on the right path and see alternative methods of solving the problem. Jumping straight to the solutions is like looking at the answers in the back of a textbook. Do you really learn anything?

The purpose of the coding challenges and projects is to build your Developer’s mind or a mind to solve puzzles and problems. As a Developer, you use your arsenal of coding skills and technologies to solve problems. The very first thing you do is break a big problem down into smaller problems. Then, by solving the smaller problems you will develop a solution for the bigger problem. That’s the development way.



I think these responses are really great and touch on something that Barbara Oakley mentions in her book A Mind for Numbers:

Speaking of talking to other people, when you’re genuinely stuck, nothing is more helpful than getting insight from classmates, peers, or the instructor. Ask someone else for a different perspective on how to solve the problem or a different analogy to understand the concept; however, it’s best that you first wrestle with the problem before you talk to anyone else, because it can embed the basic concepts deeply enough that you become receptive to the explanation.

Learning often means making sense of what we’ve ingested, and for that, we need to have ingested something. (Chapter 2: Learning is Creating)

I only started reading this book recently, but I’m finding it helpful in reevaluating my study habits and methods for grasping new topics. All the best on your path to success!



I’ve looked a few times, and I found that the way the examples solve the problem may use a bunch of ideas not yet covered by FCC training. For example, the Quote Machine example uses SCSS and a ton of jQuery that hasn’t been taught yet at that point in the training.

And the Quote Machine can be made without having to go in and figure out what each part of the example’s code contains.

I can understand why they put that rule there, but as you said, you’re better off looking at the code when all other attempts at finding a solution fail.

I do believe their projects are solvable via forums, chats, and Google, though. There’s no way they would give you a project that can only be solved by looking at their code. If you can’t find the solution via forums, chats, and Google, I’d bet you’re not asking the right questions.



I don’t think all of the challenge examples have the cleanest code or the most intuitive organization. There’s a lot of jQuery in the React projects, for example, which is usually unnecessary. And some of them (notably Game of Life) seem to hardly use React the way its meant to be used at all.

In the d3 section, all the data is copy-pasted to the top, which is strange because you can use fetch() or similar to get the data from the source in the same format.

I did struggle with d3 tutorials elsewhere on the internet until I rolled back to the same version of d3 that the examples use. v4 is modularized and pretty new and it’s tough to find tutorials for it.

I don’t remember specific examples from the front-end projects, but I do remember finishing projects and then poking through the examples and thinking there was a decent amount of strangeness.

So I wonder if they tell us not to look because their code is not necessarily a great example of how the project ought to be done… :wink:



These points are both excellent!

One of the major issues (I would actually say this is a genuine problem) is that many of the sample front end projects are built using front end frameworks that don’t get introduced until the next certificate.

This may have changed since I did the first cert - since I know they sometimes change the example project. But I remember seeing some of them after I had finished and they were built using Angular.

I think it would be better if the front end projects really only relied on the technologies that had been taught up to that point.

When someone does peek a little early (hey, it happens…no biggie) and see that ‘you have to use AngularJS to build this’ that is likely way more discouraging than not having seen the code at all! If they peek and see ‘hey, this can be built with jQuery - and it looks like they used a $getJSON request there…’ then that is more useful and encouraging to them.



+1 for Barbara Oakley! I’ve been dipping in and out of the Learning to Learn Coursera course and she is brilliant! I’ve been teaching for over 10 years and I learned so really useful things about learning from her I wish I had known 10 years ago!



I think the reason the rule is in place is just to encourage you to do the challenge for yourself first and try to solve the problem by asking others and researching, like you would in a job. It’s not like it is forbidden to look, but rather for you to learn to be resourceful before you take a sneak peek.



Yes I totally agree with you. I am trying different approaches to learning and getting around code swamp frustrations. I first try to solve it with my current knowledge, if I can not after a good effort and several tries I then go on to look for how others have solved it and try to understand so that the next time I can do it without looking.

I have also discovered that practicing is the best way to learn but there are some areas where theory, clear explanations and then good examples are the best if not the only way to do it.

1 Like


Well I understand the idea of using your own skills to solve a problem, however I must say that while this works for people and situations there are many of us who benefit from examples or by looking at code. I think I have learned a lot like this, because I make an effort to understand the solution. I think what is not good for learning is just copying and pasting others code without even trying to understand what is in the works.

We humans learn not just by effort or repetition, we also learn by example, by copying others, all animals do. So I just wanted to know what others think since I do not like to cheat but I think I am starting to disagree that looking at code when you do not understand by first means (Read-Ask-Search) counts as cheating.

I am trying different approaches to learning and getting around code swamp frustrations. I first try to solve it with my current knowledge, if I can not after a good effort and several tries I then go on to look for how others have solved it and try to understand so that the next time I can do it without looking.

I have also discovered that.

  • Practicing is the best way to learn but there are some areas where theory, clear explanations and then good examples are the best if not the only way to do it.

  • Learning from different languages has worked for me to understand programming best form different perspectives.

  • Forums and chats many times don’t help or don’t help on time. They are valuable don’t get me wrong, but where they fall short, some other way needs to be found.

I really appreciate your response, thanks.

1 Like


Yes it feels like that sometimes. I have studied human languages (2, English and French) and I can see how coding is very similar to languages. Lexicon might no be it all but if you do not have most of it or sufficient of it you cannot solve some of the problems. I have found that the more programming lexicon I get the more problems I can solve, the more creative I can be.

By the way talking about Barbara Oakley, I took one of her courses and I liked the concept of interleaving and how the mind gains by effort but also how is good to step from a problem when you are stuck and let it sink, your brain will keep working at it. So I do this, I interleave using not just leisure activities but other learning activities, topics and programming languages, concepts or paradigms. I also step from a problem when I get really stuck and work on something else or just take a break, or look at some other code solutions by others.

1 Like


Yes! I think in the same terms:



As far as the coding it has been quite easy to learn by FCC alone, my issues have been mostly learning how codepen works and how to make it work on android which is where I have been doing alot of my learning. This codepen/FCC interaction is strange. It has made me go away from FCC and search other sites for answers. This is bad for FCC I think, because it reduces much of the engagement within the community but good for us as future professionals since it teaches(forces us to learn) about other sources of information much like research. This has opened up alot of confusion because of learning many different ways of solving the same problem when not all ways are best practices.



I just looked at the code on one of the projects and it’s true they have other things that haven’t been taught in the examples. I wonder why use those examples. I think it’s a fair rule only if you taught it but if you haven’t then I’m not sure I agree. Anyways many people teaching coding actually say something different they teach to look at other’s code and learn from it. I know some people don’t want you to look and to do it yourself. I think asking does help a lot. I like experts exchange they have great help there better than stackflow.

Anyways, freecodecamp is cool but I can see why people with zero experience would get stuck. I’m stuck right now because I wasn’t prepared for projects. Even though I got to it pretty fast and it was easy until I hit one project. I could ask and probably get help. I’ll try it and see what happens.



Same here. I have learned (and still learning) much of programming I know mostly by reading and understanding code written by others. And I think it is not only “not wrong” but in fact necessary for rookie coders to learn by imitating (not copying) experienced programmers. There is absolutely nothing wrong in looking at a nicely written piece of code, cracking it down to the last symbol and reconstructing your own solution taking that previous code as a blueprint!