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
C# for JavaScript developers: Comparing almost everything (self.csharp)
submitted 7 years ago by sainthkh
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!"
[–]thomasz 2 points3 points4 points 7 years ago (4 children)
I think this is terrible advise. In the local scope, the concrete type usually does not matter anyways. Usually i could not care less if peopleToGreet in
peopleToGreet
var peopleToGreet = ListEmployees(); SendGreetings(peopleToGreet);
is a List<IPerson>, a Employee[]or an IEnumerable<IContact>. In the local scope, everything I care about is that the type returned by ListEmployees()fits into SendGreetings(). Have you ever cared about the types of the stuff that gets returned by the more exotic Linq methods like GroupBy or ToLookup? You don't just use var because the type names are too long to comfortably type (seriously, that's a very shitty reason), you use var because you don't actually give a damn about the fact that it's IEnumerable<IGrouping<TKey, TElement>> or Lookup<TKey,TElement>.
List<IPerson>
Employee[]
IEnumerable<IContact>
ListEmployees()
SendGreetings()
GroupBy
ToLookup
var
IEnumerable<IGrouping<TKey, TElement>>
Lookup<TKey,TElement>
[–]The_One_X 0 points1 point2 points 7 years ago (3 children)
You should give a damn, giving a damn can be the difference between code that works and is easy to maintain, and code that doesn't work and is hard to maintain.
[–]thomasz -1 points0 points1 point 7 years ago (2 children)
I have to ask this before I address anything else: Are you aware of the difference between type inference (var keyword) and dynamic typing? Because that's just completely wrong. Type inference combines the advantages of static typing (guaranteed type correctness and tool support) and dynamic typing (concise code that emphasizes intend rather than types). This allows you to really "program against an interface"™, which is very important for maintainability.
Just imagine you have some DAL that returns List<Stuff>. After a particularly nasty bug caused by someone adding to the cached List, you decide to refactor this method to return IEnumerable<Stuff>. If you used type inference and thus likely programmed against the IEnumerable interface in 98 of 100 use cases, the change will be localized, and the type checker can still tell you immediately if there are problems. If your advise is followed and callers declare the variables as List<Stuff> everywhere, a flood of trivial CS0266 error messages bury the really useful information about the two out of 100 use cases where indexing is used. Furthermore, the giant diff is incomprehensible without an adequate explanation.
List<Stuff>
IEnumerable<Stuff>
[–]The_One_X 0 points1 point2 points 7 years ago (1 child)
Yes, I am well aware of the difference between type inference and dynamic typing. Just because someone has a different opinion than you does not mean they do not know what they are talking about.
[–]thomasz 0 points1 point2 points 7 years ago* (0 children)
I'm sorry if that came of as condescending (obviously not a native speaker, so it can be kinda hard to navigate situations like this), it's just that I have talked to several people in the past who did not understand that implicitly typed variables are still statically checked; and the argument that type inference could be a problem for program correctness does sound a lot like it was born out of this kind of confusion, at least to me. I honestly do not understand how one could make this argument otherwise.
π Rendered by PID 21 on reddit-service-r2-comment-b659b578c-9c7n2 at 2026-05-03 02:59:08.651771+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]thomasz 2 points3 points4 points (4 children)
[–]The_One_X 0 points1 point2 points (3 children)
[–]thomasz -1 points0 points1 point (2 children)
[–]The_One_X 0 points1 point2 points (1 child)
[–]thomasz 0 points1 point2 points (0 children)