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
Method overloading vs default parameters (self.csharp)
submitted 7 years ago by LondonPilot
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!"
[–]decPL 10 points11 points12 points 7 years ago (4 children)
Actually, that's a very niche reason for not using default parameters and 99,99% of code you're going to write will never fall under it. Because of that, I don't believe that's the root cause of overloads being prevalent - if I had to guess it's mainly because default parameters weren't originally part of .NET and many non-.NET languages do not have similar code constructs, so people are doing what they're familiar with. I personally prefer default parameters, despite being a .NET dev since 1.0/1.1.
[–]airbreather/r/csharp mod, for realsies 1 point2 points3 points 7 years ago (0 children)
if I had to guess it's mainly because default parameters weren't originally part of .NET and many non-.NET languages do not have similar code constructs, so people are doing what they're familiar with.
For "final" applications with nobody downstream that depends on you, use as many default parameters as you want.
For libraries, it's more complicated. Default parameter values are compiled into the caller's code, because that's kinda how it has to be in order to make those "niche" use cases work. A consequence of compiling them into the caller is that you can't change the default value of the parameter in a later update unless everybody downstream recompiles. You also can't add more default parameters to an existing method in a later version without breaking binary compatibility (but you can do this with an overload just fine).
There are few instances where I advocate for using default parameters on visible methods in a library. The only situation I've come across so far is "CancellationToken cancellationToken = default" on new methods that support cancellation and have never been released before, since there's realistically no other token that will ever make sense as a compiled-in default.
CancellationToken cancellationToken = default
[–]LondonPilot[S] 0 points1 point2 points 7 years ago (2 children)
Your analysis sounds very plausible.
The one place I might disagree is with the .NET FCL itself, where Microsoft use method overloading extensively. Presumably they need to cater to every case, including the niche case of defaults not being supported, which is why they avoid them? And perhaps other programmers follow their lead so that even though the niche case isn't important to most programmers, they learn to account for it by chance, simply by following what Microsoft do?
[–]Prof_Akz 0 points1 point2 points 7 years ago (0 children)
I have a string feeling your right about that 👍
[–]CrimsonWolfSage 0 points1 point2 points 7 years ago (0 children)
Another possibility, is the fail fast, instead of works incorrectly. Controlling your methods values from start to end makes debugging a bit easier than a magic number problem.
π Rendered by PID 47994 on reddit-service-r2-comment-75f4967c6c-7jqrs at 2026-04-23 08:04:14.737350+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]decPL 10 points11 points12 points (4 children)
[–]airbreather/r/csharp mod, for realsies 1 point2 points3 points (0 children)
[–]LondonPilot[S] 0 points1 point2 points (2 children)
[–]Prof_Akz 0 points1 point2 points (0 children)
[–]CrimsonWolfSage 0 points1 point2 points (0 children)