r/ProgrammerAnimemes • • Mar 23 '20

Comments you can't remove

Post image
867 Upvotes

53 comments sorted by

View all comments

Show parent comment

24

u/LucasTyph Mar 24 '20

Shouldn't you just have done

if (n == 0) {
    return 1;
}

?

14

u/Tiavor Mar 24 '20

not really needed, but it would work too, that's why you can't remove the comment.

at the bottom is a "return fallback", and fallback = 1.

1

u/LucasTyph Mar 24 '20

Aaah, I understood it now. Hadn't paid much attention to where the comment ended.

6

u/bucket3432 Mar 24 '20

There are lots of things you can do to improve the code. This is just one of them.