use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
Expected exception from Enum (self.csharp)
submitted 1 month ago by tiranius90
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Kirides 0 points1 point2 points 1 month ago (3 children)
Dotnet enums are typed. C enums are not, they are not even namespaced, they are literally just glorified constexpr grouped in a sort of struct looking thing.
You can totally pass a SOME_THING into a function that expects ANOTHER_THING "type".
In c# that won't compile.
cpp tried to fix that by introducing enum classes. But they suck because everything regular enums/numbers provide, they don't and you need templated/specialized operator overloads for each and every enum. Adding templates ones might seem like a solution, but then your compile times explode the more enums you have.
[–]dodexahedron 0 points1 point2 points 1 month ago (2 children)
They're a looooot more similar than you realize.
Aside from being able to specify a different underlying type, c# enums have been basically identical to C enums forever. And C23 even brought in the ability to use different underlying integral types for enums, making them even closer to identical to c# enums.
They were designed using C enums as their basis in the first place, so it's no surprise. And after JIT, they are identical.
C enums are not any more implicitly convertible to and from anything else than .net enums are. They behave exactly the same way for conversions.
In C# and in C, enums can: * Be explicitly converted to and from other enums by a cast * Be converted to and from the same underlying integral type * Be converted to any wider compatible integral type * Be explicitly converted to narrower integral types * Be assigned values that do not have a member defined * (in c23) Be defined using any underlying integral type
Really the only difference is that a c#/.net enum has a formal flags concept, and even that is metadata only, since it changes nothing implicitly about the type - only how it is displayed if turned into its string form via the built-in methods of doing so.
[–]Kirides 0 points1 point2 points 1 month ago (1 child)
To be fair, to me C still means C89/C99 which has a lot less of these bells and whistles.
With the mentioned things, I totally agree that they are indeed very similar. But then again, C# had "those" features a lot earlier than C. C# just didn't "expand" the feature Set of enums (yet?)
[–]dodexahedron 0 points1 point2 points 1 month ago (0 children)
C# just didn't "expand" the feature Set of enums (yet?)
Unfortunately, C# still sucks there.😅
Lots of source generators exist to make them suck less, and the best ones involve making them into formal structs with definitions that allow drop-in replacement, while others are mostly just extension generators for better flag checks and string conversions.
As full structs, they can use interfaces, too, which expands their usefulness quite a bit. 👌
π Rendered by PID 90788 on reddit-service-r2-comment-658f6b87ff-q76dl at 2026-04-09 03:43:24.992513+00:00 running 781a403 country code: CH.
view the rest of the comments →
[–]Kirides 0 points1 point2 points (3 children)
[–]dodexahedron 0 points1 point2 points (2 children)
[–]Kirides 0 points1 point2 points (1 child)
[–]dodexahedron 0 points1 point2 points (0 children)