Search results

  1. O

    Iteration, recursion, optimization,

    In JavaScript, "var" defines a local variable. Even in other languages, all you would have to do is define local variables - I don't know how this would involve "ugly" re-writing. It might actually even be less code if your language is weakly typed or automatically variables as local. I'm a...
  2. O

    Iteration, recursion, optimization,

    Here's a working example in JavaScript (because you can see it online): I'm completely self-taught, so I couldn't say how they teach it at school. I'm pretty sure they wouldn't be teaching you recursion in this way however. I think you're overcomplicating it. For...
  3. O

    Iteration, recursion, optimization,

    Yes, but if I saw that no-loop solution in the wild I would most likely vomit. If I remember it was still longer than the 1 loop solution, and slower anyways because you were dealing with maps - although it was most certainly a unique solution! I don't know what this pattern is called...
  4. O

    How long does it take to learn web-programming from scratch?

    Depends, do you have ANY programming experience? I was freelancing within 2 months of picking up web development by going on eLance and doing small PHP and JavaScript projects, and slowly working my way up. I've also been coding in general almost since I could read... You could build a...