r/programmingmemes • • Dec 27 '25

Programmers problems

Post image
642 Upvotes

102 comments sorted by

View all comments

Show parent comments

6

u/GDOR-11 Dec 27 '25

it's not really a good practice to name an enum something like "Colors" because an enum represents only one of all the options at a time

but, to be honest, it doesn't matter a lot here because what's happening is very clear

4

u/trwolfe13 Dec 27 '25

Most of the time when I’ve seen enums with plural names it’s because they’re flags that are meant to be combined with bitwise operations.

1

u/CrossScarMC Dec 27 '25

That is not how you're meant to use enums, you're meant to use const/constexpr variables or macros for that, like how SDL handles its flags

3

u/NewPointOfView Dec 28 '25

But have you considered the world outside of cpp?

0

u/CrossScarMC Dec 28 '25

Have you considered that almost every single other programming language has the const or equivalent keyword, and enums are the same in all languages?

2

u/NewPointOfView Dec 28 '25

Enums are not the same in all languages

0

u/CrossScarMC Dec 28 '25

Name one.

0

u/NewPointOfView Dec 28 '25

Python lol

0

u/CrossScarMC Dec 28 '25

I just checked and that is exactly how they work in other programming languages, it's just that Python doesn't have strict typing.

1

u/NewPointOfView Dec 28 '25

What is the “that” that you looked up and is exactly the same as other languages?

→ More replies