r/programminghorror • • Feb 28 '26

Do you like my FizzBuzz implementation

Post image
1.3k Upvotes

218 comments sorted by

View all comments

Show parent comment

-22

u/Bosonidas Feb 28 '26

The "FizzBuzz" is hard coded. If i asked you to add "Ruzz" on % 9 the code would need to change a lot and possibilities would skyrocket.

See tom scott video on this for decent solutions and explainations.

21

u/ababcock1 Feb 28 '26

You and I have very different definitions of "horror".

1

u/Bosonidas Mar 01 '26

Hey, I didnt post this. Just trying to explain.

-3

u/SlaimeLannister Feb 28 '26

True programming horror is my habit of over-engineering

16

u/ShadowDevil123 Feb 28 '26

So we are supposed to make practice code snippets scalable?

9

u/int0h Feb 28 '26

Should be at least five cloud based microservices costing $5k per month to run.

12

u/Kevdog824_ Feb 28 '26

The real horror was the premature optimization we met along the way!

2

u/NebNay Mar 01 '26

Scalable apply only to big picture. It's quicker to make this match the required spec and refactor it when they change than to plan for a potential change in 6 month that might or might not happen. We have a saying in my team "dont waste 4 hours to save 2 in 6 months"

2

u/Bosonidas Mar 01 '26

Disagree. A solution that builds the whole pattern is both shorter and more pythonic. FizzBuzz is a learning task. To not learn with it and "just hit the spec" fails its purpose, imho.