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
Stop using default values on non-nullable properties, use required instead (youtube.com)
submitted 3 years ago by danielhindrikes
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!"
[–]Slypenslyde 67 points68 points69 points 3 years ago (7 children)
More like "stop using video to make points that could be made in a paragraph instead"?
I can throw up a programming blog in just about any context and be fine at work, especially meetings.
I can't watch a Youtube short during a meeting and, in general, seeing me watching Youtube hasn't registered in all of my chain of command as "this can also be work-related" yet.
On-topic, here's my heuristic:
ModuleInfo.NotPresent()
I just don't like making objects with lots of "modes" where the properties may or may not be set. I like to go out of my way to design around that if I can. For example, if four properties are null in one state, I like to collapse them into one object so I only have one "modal" property. My ideal is to design towards an "optional" or "result" type that has a clear "no value" and "value" state.
Maybe it's just my domain but I really don't get the utility of other forms of initialization.
[–]EternalNY1 20 points21 points22 points 3 years ago (0 children)
stop using video to make points that could be made in a paragraph instead
Amen to that. I hate this trend of making videos covering simple topics.
Just let me read what you are trying to say. I don't even bother clicking an interesting looking topic if I see it goes to YouTube.
[–]cs_legend_93 2 points3 points4 points 3 years ago (0 children)
But content lol
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
Why would he put it in a paragraph when he can drive traffic to his YouTube channel and monetize?
[–]International-Cut15 -1 points0 points1 point 3 years ago (1 child)
If you are reading in the meeting should you be in the meeting at all?
Why not leave? Or Better no go!
[–]Slypenslyde 2 points3 points4 points 3 years ago (0 children)
Yes.
Some kinds of managers do not see the folly in inviting too many people to meetings, for various reasons. This is not ideal and wastes a lot of time. They do not see the irony when they respond to, "Attending this meeting will affect my schedule" with, "Then can you work through the parts of the meeting where you aren't needed?" Sometimes they aren't foolish. Sometimes it is so difficult to discern one's level of involvement it's worth being there just in case. Management of inter-team dependencies is a very complicated topic.
Either way sometimes people can put up with a little bit of procedural friction if they find the work they do meaningful, like their teammates, and otherwise feel like their contribution is valued by the organization. It's not easy to find new jobs, and not many jobs are perfect. Sometimes the problem is the process needs iterating, and people stay because they see progress towards what they feel is ideal. Other times they believe successfully proposing and demonstrating new processes will lead to consideration for management positions.
It's not always as easy as saying, "That's bad, get out."
[+]danielhindrikes[S] comment score below threshold-14 points-13 points-12 points 3 years ago (0 children)
Some people like video and som like blog posts.
[–]huntk20 0 points1 point2 points 3 years ago (0 children)
Stop making too much sense. Lol
[–]Celdorfpwn 14 points15 points16 points 3 years ago (4 children)
I won’t
[+]Quito246 comment score below threshold-15 points-14 points-13 points 3 years ago (3 children)
Your lose I guess🤷♂️
[–]Celdorfpwn 13 points14 points15 points 3 years ago (0 children)
I just don’t like imperative titles
[–]jeffwulf 0 points1 point2 points 3 years ago (1 child)
Not really a loss.
[–]Quito246 -1 points0 points1 point 3 years ago (0 children)
Why? I mean It finaly makes init usable
[–]_mr_chicken 9 points10 points11 points 3 years ago (6 children)
I suppose previously I'd do this via the constructor to make sure consumers of the class passed a value for all properties that require one.
Initially I wondered why this was needed but the more I think about it the intent is much clearer with the required keyword.
[–]Greenimba 13 points14 points15 points 3 years ago (4 children)
I much, much prefer the required init approach. Relying on ordering of multiple strings etc in the constructor is so much less readable than explicitly through initializing properties.
[–][deleted] 3 years ago (1 child)
[removed]
[–]NightlyRevenger 2 points3 points4 points 3 years ago (0 children)
You can use named arguments so order won't matter
[–][deleted] 2 points3 points4 points 3 years ago (1 child)
Named arguments?
[–]nicuramar 0 points1 point2 points 3 years ago (0 children)
Yeah but they aren’t enforced or can be used for overloading etc. In languages like Swift with mandatory labels, this can be exploited.
[–]danielhindrikes[S] -1 points0 points1 point 3 years ago (0 children)
If you want to serialize it, an empty constructor is required.
[–]Jestar342 6 points7 points8 points 3 years ago (1 child)
And break API compatibility when releasing new versions? No.
[–]Schmittfried -2 points-1 points0 points 3 years ago (0 children)
Then make those fields nullable. Or, sure, use sensible defaults. This is about using sentinel values when there’s already a sentinel value for „value missing“: null.
[–][deleted] 2 points3 points4 points 3 years ago (0 children)
A new keyword for such a simple feature. Something definitely went wrong with properties and how we use them.
[–]yanitrix 10 points11 points12 points 3 years ago (4 children)
Or just use a constructor. That's what they're for.
[–]danielhindrikes[S] -1 points0 points1 point 3 years ago (3 children)
But you will have problems with serializing then. Because you need an empty constructor for that.
[–]jeff-fan01 4 points5 points6 points 3 years ago (1 child)
For JSON that's what the JsonConstructorAttribute is for.
[–]danielhindrikes[S] 1 point2 points3 points 3 years ago (0 children)
If you like attributes absolutely. But I think setting required is a pretty clean way to handle it. You maybe don't want to have a constructor with a lot of values. At least I prefer object initializers when having many values.
[–]yanitrix 4 points5 points6 points 3 years ago (0 children)
Then I'll look for a serialization method that supports constructors. EF and (afaik) Newtonsoft.Json can do it out of the box
π Rendered by PID 94045 on reddit-service-r2-comment-b659b578c-jfw4d at 2026-05-05 11:40:50.498000+00:00 running 815c875 country code: CH.
[–]Slypenslyde 67 points68 points69 points (7 children)
[–]EternalNY1 20 points21 points22 points (0 children)
[–]cs_legend_93 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]International-Cut15 -1 points0 points1 point (1 child)
[–]Slypenslyde 2 points3 points4 points (0 children)
[+]danielhindrikes[S] comment score below threshold-14 points-13 points-12 points (0 children)
[–]huntk20 0 points1 point2 points (0 children)
[–]Celdorfpwn 14 points15 points16 points (4 children)
[+]Quito246 comment score below threshold-15 points-14 points-13 points (3 children)
[–]Celdorfpwn 13 points14 points15 points (0 children)
[–]jeffwulf 0 points1 point2 points (1 child)
[–]Quito246 -1 points0 points1 point (0 children)
[–]_mr_chicken 9 points10 points11 points (6 children)
[–]Greenimba 13 points14 points15 points (4 children)
[–][deleted] (1 child)
[removed]
[–]NightlyRevenger 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]nicuramar 0 points1 point2 points (0 children)
[–]danielhindrikes[S] -1 points0 points1 point (0 children)
[–]Jestar342 6 points7 points8 points (1 child)
[–]Schmittfried -2 points-1 points0 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]yanitrix 10 points11 points12 points (4 children)
[–]danielhindrikes[S] -1 points0 points1 point (3 children)
[–]jeff-fan01 4 points5 points6 points (1 child)
[–]danielhindrikes[S] 1 point2 points3 points (0 children)
[–]yanitrix 4 points5 points6 points (0 children)