3 ms·
Some languages don’t have loops but rather have very good tail-recursive semantics. In that case, nothing is hiding in the stack. Talking about loops vs recurs
by imoverclocked 6y ago
Some languages don’t have loops but rather have very good tail-recursive semantics. In that case, nothing is hiding in the stack.
Talking about loops vs recursion is interesting but it feels kinda like salt vs pepper to me. I like both and use both where appropriate.
While we are on the topic of similarly misused constructs, .stream() pipelines in Java are often clear and concise but as they get longer and hide more stuff in the stream, a loop would make far more sense and provide a much smaller runtime complexity.
Often, people will aspire to create “beautiful” code where they relate recursion/loops/streams/etc as something beautiful. In that vein, I don’t really care if code is “ugly” but I do care if it’s unmaintainable, needlessly slow or accidentally complex.
- moron4hire 6y agoYeah, one of my last favorite phrases is "elegant code". "Elegance" is an attribute I'd assign to a dinner party, not work.
- thebigspacefuck 6y agoMath heads frequently use the term for proofs. I see it as carry over