I just recently finished CodeCademy's JavaScript track. I'm assuming this is a small % of the knowledge really needed to be able to actually build shit. I went on CoderByte (http://coderbyte.com) and tried some of their "Easy" challenges and I'm struggling with some of the basic ones because it is stuff that was not taught on CodeCademy. The 2nd question was to write code to return the factorial of a number. Is this really basic shit, or did I just run into a weird question that is not very common in real world programming? I haven't taken higher level math in probably 15 years so I was concerned about this going into this process of learning JS but numerous people told me it wasn't that important. Are there other resources I should be learning from? What do you recommend to improve in the early stages? I'm trying to learn enough to get into a program like Hack Reactor.
The factorial example is used in many programming tutorials, not to teach you that you need to understand complicated mathematical theory to become a programmer (you don't, so don't worry), but instead to teach you one of the more advanced paradigms of beginner programming: recursion (having a function call itself again and again until it's to-be-returned value is adequate enough to finally be returned).<p>Learning more about the language is always going to help, though. I would suggest doing the CodeCademy track a second time to see if you've improved. Focus on writing efficient solutions that are better than what you would have done your first time around. Once that is done, give these resources a go:<p>- <a href="http://codeschool.com" rel="nofollow">http://codeschool.com</a>
- <a href="http://lynda.com" rel="nofollow">http://lynda.com</a>
- <a href="http://teamtreehouse.com" rel="nofollow">http://teamtreehouse.com</a><p>I would also suggest purchasing these books, as they are somewhat the standard learning and reference resources:<p>- JavaScript: The Good Parts
- JavaScript: The Definitive Guide<p>There are other books that will help tremendously, and a list of free ones can be found at <a href="http://jsbooks.revolunet.com" rel="nofollow">http://jsbooks.revolunet.com</a><p>Other books I recommend:<p>- Eloquent JavaScript
- Effective JavaScript
- High Performance JavaScript
- Maintainable JavaScript
- Principles of Object-Oriented Programming in JavaScript
- JavaScript Patterns
- The Past, Present and Future of JavaScript
- JavaScript Enlightenment
- Secrets of the JavaScript Ninja
Honestly, yes factorial functions are really basic stuff. You should definitely have the tools necessary to implement factorial both iteratively and recursively after a brief into to Javascript.<p>That's not to say you don't have to think about it, or that your code will run perfectly the first time. Veterans don't walk around with the code for fact in their head. But you should be able to go through the process to getting the right answer.<p>It doesn't really matter how long it takes to get to the solution, do not feel bad that it's a struggle. The "this just doesn't make any fucking sense" feeling is normal for a new programmer, and it DOES pass.<p>Absolutely resist the urge the just search for the answer. That pain you feel in your head is part of the learning process.<p>Good luck with your challenge!