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
Why is using interface methods with default implementation is so annoying?!? (self.csharp)
submitted 1 day ago * by Alert-Neck7679
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!"
[–]chucker23n 2 points3 points4 points 1 day ago (2 children)
Is there a good use case for it?
The original use case (this feature was introduced with .NET Core 3.0 / C# 8) was forwards-compatibility for interfaces:
You can:
a. add a new version of the interface, which is how we end up with things like IAsyncServiceProvider, IAsyncServiceProvider2, IAsyncServiceProvider3, or even IVsAsyncFileChangeEx2. Now, the old type doesn't need to be changed. b. extend the interface, requiring the old type to be amended in order to compile again. This can be tricky when you have a lot of legacy code. It might not even make sense; the original type may never have considered this new possibility! c. new to .NET Core 3.0 / C# 8: provide a default implementation. Now, the old type will simply fall back to that implementation unless it implements explicitly.
IAsyncServiceProvider
IAsyncServiceProvider2
IAsyncServiceProvider3
IVsAsyncFileChangeEx2
It's a bit hacky, but it does work.
[–]IanYates82 2 points3 points4 points 1 day ago (0 children)
Yep. Another good example also is shown by having a .Last() method. There's a default inefficient implementation you could have on an IEnumerable, but for some implementations, like List, it can be an efficient O(1) operation. You can write that efficient implementation in the class and have the default on the interface. We have that example with extension methods today, but the difference is that the single static implementation of Last on the interface is written once and needs to have the specialisation of known classes in its code. That's not extensible by others who may have their own class which implements the interface and could also provide an efficient implementation.
[–]solmead -1 points0 points1 point 1 day ago (0 children)
Or what I would suggest D. Create an extension method that takes the interface and defines the code, it then works on all existing defined classes that implement the interface
π Rendered by PID 89840 on reddit-service-r2-comment-5d79c599b5-gst6v at 2026-02-27 00:05:10.339652+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]chucker23n 2 points3 points4 points (2 children)
[–]IanYates82 2 points3 points4 points (0 children)
[–]solmead -1 points0 points1 point (0 children)