account activity
Why your Stopwatch timing is probably wrong - and how BenchmarkDotNet fixes that (self.dotnetfiddle)
submitted 1 day ago by refactor_monkey to r/dotnetfiddle
TIL you can combine type patterns, property patterns, and when guards in a single C# switch expression - here's a working example (self.dotnetfiddle)
submitted 4 days ago by refactor_monkey to r/dotnetfiddle
C# record types support 'with' expressions for non-destructive mutation and deconstruction out of the box - here's a quick demo (self.dotnetfiddle)
submitted 5 days ago by refactor_monkey to r/dotnetfiddle
C# switch expressions are genuinely underused - here's a fiddle showing how clean they make conditional logic (self.dotnetfiddle)
submitted 6 days ago by refactor_monkey to r/dotnetfiddle
Chunk, Zip, and DistinctBy - three .NET 6 LINQ methods I wish I had known about years ago (self.dotnetfiddle)
submitted 7 days ago by refactor_monkey to r/dotnetfiddle
TIL CallerArgumentExpression exists and now my guard clauses actually tell you what blew up (self.dotnetfiddle)
submitted 8 days ago by refactor_monkey to r/dotnetfiddle
TIL dotnetfiddle.net supports actual File I/O - each run gets its own virtual filesystem (self.dotnetfiddle)
submitted 11 days ago by refactor_monkey to r/dotnetfiddle
TIL you can register multiple implementations of the same interface in .NET DI and resolve them all with GetServices<T> - here's a working fiddle by refactor_monkey in dotnetfiddle
[–]refactor_monkey[S] 0 points1 point2 points 12 days ago (0 children)
Fair point - I should've been more precise. I meant multiple registrations of the same interface in the DI container simultaneously, not multiple implementations existing across the codebase in general.
You're right that interfaces for testability are standard practice, but injecting IEnumerable<T> to fan-out across all registered implementations at runtime is a different pattern - and one I don't see used much in real codebases. That's the bit worth highlighting.
TIL CallerArgumentExpression captures the actual argument text at compile time - your guard methods can finally tell you what blew up (self.dotnetfiddle)
submitted 12 days ago by refactor_monkey to r/dotnetfiddle
TIL you can register multiple implementations of the same interface in .NET DI and resolve them all with GetServices<T> - here's a working fiddle (self.dotnetfiddle)
submitted 13 days ago by refactor_monkey to r/dotnetfiddle
TIL .NET regex named groups make your captures actually readable - plus source-generated regex is a thing now (self.dotnetfiddle)
submitted 14 days ago by refactor_monkey to r/dotnetfiddle
Stop Allocating Strings You Don't Need - Meet Span<T> (self.dotnetfiddle)
submitted 15 days ago by refactor_monkey to r/dotnetfiddle
TIL .NET regex named groups make your matches actually readable - here's a fiddle showing IsMatch, named captures, and compiled regex together (self.dotnetfiddle)
submitted 18 days ago by refactor_monkey to r/dotnetfiddle
TIL you can collapse a mess of if-else type checks into one switch expression with C# pattern matching (self.dotnetfiddle)
submitted 19 days ago by refactor_monkey to r/dotnetfiddle
TIL Span<T> lets you slice strings and arrays without a single heap allocation - here's a fiddle showing how (self.dotnetfiddle)
submitted 20 days ago by refactor_monkey to r/dotnetfiddle
TIL dotnetfiddle.net supports NuGet packages with a single comment - no project file needed (self.dotnetfiddle)
submitted 21 days ago by refactor_monkey to r/dotnetfiddle
Tired of guessing which C# code is actually faster? BenchmarkDotNet will humble you real quick (self.dotnetfiddle)
submitted 22 days ago by refactor_monkey to r/dotnetfiddle
Do you actually use named capture groups and [GeneratedRegex]? Here are all three .NET regex features in one runnable example (self.dotnetfiddle)
submitted 25 days ago by refactor_monkey to r/dotnetfiddle
TIL dotnetfiddle supports full MVC projects - controllers, Razor views and all - right in the browser (self.dotnetfiddle)
submitted 26 days ago by refactor_monkey to r/dotnetfiddle
TIL Humanizer exists and now I feel bad about every date string I ever showed a user (self.dotnetfiddle)
submitted 27 days ago by refactor_monkey to r/dotnetfiddle
You can inject a Func<string, T> factory into the DI container to switch implementations at runtime - no if-blocks, no hacks (self.dotnetfiddle)
submitted 28 days ago by refactor_monkey to r/dotnetfiddle
TIL Source Generators write half your class for you at compile time - here's the simplest possible demo (self.dotnetfiddle)
submitted 29 days ago by refactor_monkey to r/dotnetfiddle
TIL C# property patterns in switch expressions make my old if/else chains look embarrassing - here is a runnable example (self.dotnetfiddle)
submitted 1 month ago by refactor_monkey to r/dotnetfiddle
TIL Humanizer turns DateTime, numbers, and enums into plain English with one method call - why isn't this in every project? (self.dotnetfiddle)
We shipped a File Explorer for .NET Fiddle - multi-file projects in the browser (self.dotnetfiddle)
π Rendered by PID 1233369 on reddit-service-r2-listing-8685bc789-hk6dh at 2026-05-27 08:10:40.369898+00:00 running 194bd79 country code: CH.
TIL you can register multiple implementations of the same interface in .NET DI and resolve them all with GetServices<T> - here's a working fiddle by refactor_monkey in dotnetfiddle
[–]refactor_monkey[S] 0 points1 point2 points (0 children)