3 ms·
Factorial recursion solution is flashy? It's supposed to be high school level stuff.
by golergka 11y ago
Factorial recursion solution is flashy? It's supposed to be high school level stuff.
- YeGoblynQueenne 11y agoThey were expecting an iterative solution, so giving them a recursive one came across as a bit snotty. As it should. What language did you do your high-school level stuff in? I assume it wasn't Java, because in Java there are no good reasons to use recursion (it provides iterative primitives, unlike say Haskell, Prolog, Lisp etc) and there are good reasons not to (its compiler doesn't (or didn't) do tail-call optimisation). Not to mention, any language without pattern matching is a bit shit for teaching recursion anyway: you tend to miss the point because of all the bookkeeping.
- golergka 11y agoPascal and lisp-like language that was created for teaching purposes in our school. Still, recursion was among the first procedural programming topics, right after procedures themselves, if I remember correctly.
- YeGoblynQueenne 11y agoPascal and lisp-like? What school was that, or rather -when was that? Recursion is generally considered hard by most programmers, hence why my interviewers thought I was showing off. You can google a bit and see that people do indeed have trouble getting their heads around it.