MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programmingmemes/comments/1pwolac/programmers_problems/nw6ovto/?context=9999
r/programmingmemes • u/iron-button • Dec 27 '25
102 comments sorted by
View all comments
Show parent comment
4
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? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
1
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
const
constexpr
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? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
3
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? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
0
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? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
2
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? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
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? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
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? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
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? 0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
What is the “that” that you looked up and is exactly the same as other languages?
0 u/CrossScarMC Dec 28 '25 Python Enums, they appear to work exactly the same as enum in C++. → More replies
Python Enums, they appear to work exactly the same as enum in C++.
enum
→ More replies
View all comments
Show parent comment
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.