4 ms·
I can’t tell if this is sarcasm but if it isn’t it just proves the point. Your teammates must just love working with you. I’d love to see the look on their face
by zcw100 8y ago
I can’t tell if this is sarcasm but if it isn’t it just proves the point. Your teammates must just love working with you. I’d love to see the look on their faces when you committed that code. “I just learned Erlang. Check out what I did without telling anyone. Suck it. Boom!”
- darkhorn 8y agoIt is not sarcasm. Yes, they love working with me, they learn new things from me and they use it. Generally their face is like "o_O I wish I've learned it before". I use build-in functions of PHP and Java in way without loops, there is nothing unknown. I don't write Erlang code. Here is an example what I mean; <?php declare(strict_types=1); function fibonacci_nth(int $n): int { if($n === 0) return 0; if($n === 1) return 1; else return fibonacci_nth($n - 2) + fibonacci_nth($n - 1); } function fibonacci_series(int $n): array { return array_map('fibonacci_nth', range(0, $n)); } And here in Python class Fibonacci: def fibonacci_nth(self, n): if(n == 0): return 0 if(n == 1): return 1 else: return self.fibonacci_nth(n-1) + self.fibonacci_nth(n-2) def fibonacci_series(self, n): return [self.fibonacci_nth(x) for x in range(n+1)]
- jodrellblank 8y ago"no loops means less bugs" But the loops will be clear and explicit. People can check if you have an off-by-one error. Python does not support many recursive calls, after "n" gets beyond a certain number, the code will crash with a RecursionError. That is a bug which is much harder to see. The code will crash if N < 0 for the n_th() method, which is probably a bug.