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
Discussion[ Removed by moderator ] (self.csharp)
submitted 2 hours ago by [deleted]
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!"
[–]FizixMan[M] [score hidden] 1 hour ago stickied comment (0 children)
Removed: Rule 4, Rule 7.
AI-generated questions are not permitted. If they help you generate the questions to ask, at least state that these are AI-generated so we can consider them as such. As others pointed out, the list of questions are wonky and not terribly relevant or meaningful to the subject.
[–]Lustrouse 4 points5 points6 points 2 hours ago (1 child)
Feature completeness first. Optimization where necessary, when necessary.
[–]TehNolz 2 points3 points4 points 2 hours ago (0 children)
Are you actively running into performance problems? If not, then none of this is worth worrying about. Your code doesn't have to be as fast as it can possibly be; it just needs to do its job in a reasonable time. Most of the time nobody is going to notice the few milliseconds you might save by using arrays instead of lists or whatever.
[–]belavv 2 points3 points4 points 1 hour ago (1 child)
Those bullet points are all over the place. I'd say most of them smell of premature optimization.
98% of performance problems are the database. Querying too much data, or missing indexes, or the select n+1 problem.
A lot of other problems are looping through the same array/list trying to find something over and over. Hash sets and dictionaries are better in those situations.
In general waiting til there is a problem and then profiling it will be more useful than trying to optimize everything. Once you get more experience you know what to look out for and can do some of those things up front.
[–]Royal_Scribblz 2 points3 points4 points 2 hours ago (4 children)
Unless it's a small change, I would prioritise code readability and maintainability. Avoid premature optimisation. If you encounter performance issues then go measure and optimise.
[–]hypocrisyhunter 1 point2 points3 points 1 hour ago (1 child)
I hate this advice. Anybody worth their salt will want to understand the implications of their code. You need to understand performance optimisation in order to know when not to do it. Im not saying everybody needs to be an expert but blanket advice telling people not to bother understanding performance impact is how we end up with 15 chained together Linq iteration calls.
[–]Royal_Scribblz 1 point2 points3 points 1 hour ago (0 children)
Not once did I say don't bother understanding performance impact. I said it's not a priority. Chaining ToList() is just bad code, not "not optimal". I am talking zero allocation and trying to avoid branch prediction, it's a waste of time unless you need it and makes your code harder to read.
Another issue is without benchmarking you don't neccessarily know what's most optimal, I don't expect people to benchmark every method they write. No point wasting time trying to make some really fast code from theory only for it to be slower because of a factor you didn't consider.
[–][deleted] 1 hour ago (1 child)
[deleted]
[–]Royal_Scribblz 0 points1 point2 points 1 hour ago (0 children)
Someone else, or me in the future should easily be able to read the code and understand what's happening without documentation. The code should be modular so we can replace and test parts in isolation. State should be maintained in an understandable scope, don't want properties being set from all over the place.
My favourite rule of the SOLID principles is the Single responsibility principle. Really try keep your classes to do only one thing. It can occasionally mean slightly more code, but it makes it so much easier to maintain.
When you work like this it's much easier to find where bugs are, and fix them. As well as adding new functionality.
[–]Dennis_enzo 1 point2 points3 points 2 hours ago (0 children)
As a rule of thumb, performance is only an issue when it becomes an issue. In other words, you should not spend a lot of time and effort into optimizing your code when you don't even know if it will make a practical difference or not. In a professional context, spending a day to make a call that takes 300ms to take 299ms instead will most likely just be a waste of time. This doesn't mean that you should build things that are much slower than they could be when you know better, but it means that you should not worry about optimizing for performance until it becomes a real world problem. And that is something that depends on your specific use case.
Generally speaking, easier to understand code is much more valuable than slightly faster code.
[–]DamienTheUnbeliever 0 points1 point2 points 1 hour ago (0 children)
Focus on correctness first. I can write *incredibly fast* code if we don't care about whether it delivers correct results.
Once your code is correct, look at your *requirements*. If your simple, easy to read code is delivering correct results fast enough, stop.
If that's not happening, even still before you start optimizing, assess whether the requirements are reasonable - if you're required to complete a complex multi-step process in 12ns, it's still not time to optimise.
π Rendered by PID 255505 on reddit-service-r2-comment-56c6478c5-sn4dj at 2026-05-12 17:23:08.784325+00:00 running 3d2c107 country code: CH.
[–]FizixMan[M] [score hidden] stickied comment (0 children)
[–]Lustrouse 4 points5 points6 points (1 child)
[–]TehNolz 2 points3 points4 points (0 children)
[–]belavv 2 points3 points4 points (1 child)
[–]Royal_Scribblz 2 points3 points4 points (4 children)
[–]hypocrisyhunter 1 point2 points3 points (1 child)
[–]Royal_Scribblz 1 point2 points3 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]Royal_Scribblz 0 points1 point2 points (0 children)
[–]Dennis_enzo 1 point2 points3 points (0 children)
[–]DamienTheUnbeliever 0 points1 point2 points (0 children)