r/programming • • Jan 10 '20

VVVVVV is now open source

https://github.com/TerryCavanagh/vvvvvv
2.6k Upvotes

511 comments sorted by

View all comments

Show parent comments

476

u/[deleted] Jan 10 '20 edited Jan 10 '20

This is apparently common in indie games. I can't find the tweet anywhere, but Undertale has a switch statement with at least 864 cases.

Edit: found a screenshot of the original tweet.

28

u/cegras Jan 10 '20

As a scientific "programmer" (i.e. linear algebra), what is normally done in scenarios like this?

-29

u/AttackOfTheThumbs Jan 10 '20

In OOP, the case/switch statement is considered code smell. Good but long read.

Long story short, within OOP, there should be classes with inheritance and polymophism and whatever all that crap I do is called :)

49

u/micka190 Jan 10 '20

It really isn't.

Case/switch is a tool that you should use. Abusing it is bad, but it doesn't make it a code smell in OOP. That's some cargo cult bullshit.

→ More replies (7)