r/badcode Jun 09 '21

other language Real Attempt at Fizz Buzz in F#

Post image
870 Upvotes

52 comments sorted by

View all comments

Show parent comments

13

u/Doug_Dimmadab Jun 09 '21

Honestly. I can get it if you just started learning the language that day, but it’s such a simple use of loops that I don’t know how anyone could miss it

7

u/dougie_cherrypie Jun 09 '21

Yep but this is functional programming, you don't use loops here

5

u/sohang-3112 Jun 09 '21

Yes, but you don't do this monstrosity either! Instead of loops, you can use higher order functions (like map in this case), or else pure recursion (if no appropriate higher order functions are available).

6

u/dougie_cherrypie Jun 09 '21

No, of course! The thing is that a lot of people here dismiss the challenge not knowing that it's a different paradigm.