Hacker News new | ask | show | jobs
by zaroth 4441 days ago
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.

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.

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.

Absolutely resist the urge the just search for the answer. That pain you feel in your head is part of the learning process.

Good luck with your challenge!

1 comments

Took a quick look at coderbyte, also keep in mind a big part of learning the language is understanding the different underlying types, how to convert between them, and what built-in functions they provide.

For example, the very first challenge (string reversal) in some languages you'll get a reverse function right off of the string, but in others you have find another way, which may involve getting access to each character and rebuilding the string by hand.

Try solving the same simple problem as many DIFFERENT ways as you can, that can really help flesh out basic understanding the way to Get Things Done in that language.