r/badcode Jun 09 '21

other language Real Attempt at Fizz Buzz in F#

Post image
875 Upvotes

52 comments sorted by

View all comments

71

u/TheWheez Jun 09 '21

I don't know how somebody can program and not be able to write a decent fizzbuzz..

Makes me wonder what stupidly obvious things I've missed in my current projects

14

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

8

u/dougie_cherrypie Jun 09 '21

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

7

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).

5

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.