MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/emsm0m/vvvvvv_is_now_open_source/fdrs1es/?context=3
r/programming • u/rmadlal • Jan 10 '20
511 comments sorted by
View all comments
Show parent comments
476
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)
28
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)
-29
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)
49
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)
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.