I asked the people on the r/ProgrammingLanguages Discord server to "implement a function that prints N numbers of the Fibonacci sequence". For fun, I decided to analyse the results a bit.
- no keyword: 4 (28.57%)
- no function declared: 3 (21.42%)
fn
: 2 (14.28%)def
: 2 (14.28%)function
: 2 (14.28%)func
: 1 (7.14%)
- indentation: 8 (57.14%)
- braces: 5 (35.71%)
- no block used: 1 (7.14%)
=
: 10 (71.42%)- no assignments used: 3 (21.42%)
<-
: 1 (7.14%)
for
: 7 (50.00%)repeat n times
,repeat n
,n times
: 3 (21.42%)- no loop used: 3 (21.42%)
while
: 1 (7.14%)
- no explicit terminator: 10 (71.42%)
- semicolon: 2 (14.28%)
- did not write multiple statements: 2 (14.28%)
- no type annotations: 11 (78.57%)
- type annotations: 2 (14.28%)
- no variables declared: 1 (7.14%)
- loop: 10 (71.42%)
- recursive function: 2 (14.28%)
- no proper implementation: 2 (14.28%)
- prints
n
elements of the Fibonacci sequence (a separate loop that called the actual fib implementation once for each element counts as well): 8 (57.14%) - does not print anything, but is able to return the
n
th element of the Fibonacci sequence: 3 (21.42%) - no proper implementation: 2 (14.28%)
- does not print anything, but is able to return a list containing
n
elements of the Fibonacci sequence: 1 (7.14%)
- wrote working Javascript: 1 (7.14%)
- wrote working Python: 1 (7.14%)
- wrote something else: 12 (85.71%)