Pinned Tweet
New places (no content yet):
• mastodon.nz/@ashmind
• cohost.org/ashmind
Recently I was thinking about "time-travel" alternatives to traditional debugging for SharpLab's continuous Run.
Here's one outcome. SharpLab used to dump all loop values at once, but that wasn't too useful. Now you can select a specific iteration and see values and flow within.
Happy to see !! feedback considered and !! excluded for now.
As someone said in previous comments, !! would make "string x" obsolete — we would always use either "string? x" or "string x!!".
Personally I am still keen for <Nullable>enforce</Nulable> but I do get the concerns.
The blog post for C# 11 preview updates in Visual Studio 17.2 Preview 3/.NET 7 Preview 3 is up: devblogs.microsoft.com/dotne…
As a Russian, I want to say: please listen to Ukrainians and try to help if you can.
This pointless, idiotic invasion war is a (yet one more) black mark on Russia's history.
Replying to @STeplyakov
Here are a few steps you personally can do:
1. Support the Ukrainian army
2. Ban everyone who thinks that the invasion is justified! Are you kidding me! It’s fucking not!
3. Share this and express your support for our country!
#UkrainiansAbroad
bank.gov.ua/en/news/all/nats…
"Giving up" is an underrated developer skill.
16 hours into a nice refactoring, branch has 300 files changed, 100 will need new tests?
Give up.
Couldn't convince team your code style is best?
Give up.
Love personally reviewing every single PR, but the team is growing?
Give up.
Going to enable a very aggressive (and very overengineered) cache on SharpLab, please report any issues.
Regular, 1x dev: Decides to add a cache. Adds a cache.
Me, 0.01x dev: Persistent cache? What if someone puts PII into SharpLab, must encrypt at rest. Browser is untrusted, must write from server. Can ask branch API, what if URL is faked?
Days later, lots of learnings, no cache.
I was curious if you can achieve something like npm scripts (arbitrary commands) with dotnet run -- and you can!
Only thing needed is this small csproj in top solution folder:
gist.github.com/ashmind/dd2d…
(This is a proof-of-concept, not fully cross-platform, not polished at all)
And yep I know I can do a custom tool and call it e.g. run2, but I liked the symmetry between npm run and dotnet run here, and it was an interesting challenge.
Tired of using SharpLab to decompile C# to IL?
No problem!
Thanks to great work by @konradkokosa and @vivekmapara you can now decompile IL to to C# instead.
sharplab.io/#v2:DYLglsA+ACBs…
A tech pattern to avoid: automatically using latest version.
jQuery CDN's -latest got fixed at v1.11, PowerShell's StrictMode -Latest might break your scripts in the future, Azure/arm-deploy GitHub Action picks GH VM's /latest az cli — which just broke it for everyone.
Writing low-allocation code in new .NET (Memory/Spans/Pools) is quite fun.
(Side-projects only, too complex for work)
It builds a mindset: looked to replace ArrayPool with MemoryPool, but MP Rent() returns a disposable ref type — suspicious. Checked code, yep, always allocates.
Thanks to everyone who voted for this!💎
I very much appreciate both the outcome and the message that SharpLab is useful to all of you.
You’re unable to view this Post because this account owner limits who can view their Posts. Learn more
I was interested in trying out source generators, so I built this prototype source-generator-based mocking framework:
github.com/ashmind/SourceMoc…
I like how symmetrical Setup/Calls end up being. Note that all parameters are optional, thanks to source generators.
5. Using attributes to setup generators is a bit awkward. I would love to have Get<I> giving you MockOfI, or Query("select id, name from client") giving you (id, name) without any extra setup. But that requires C# to overload by specific generic type or specific string literal.








![Code block (C#):
[Fact]
public void MultipleArguments() {
var mock = new CalculatorMock();
mock.Setup.Sum(1, 2).Returns(3);
Assert.Equal(3, mock.Sum(1, 2));
}](https://pbs.twimg.com/media/E0cvnk1VoAMwrgB.png?name=small&format=webp)
![Code block (C#):
[Fact]
public void Calls() {
var mock = new CalculatorMock();
mock.Sum(1, 2);
Assert.Equal(new[] { (1, 2) }, mock.Calls.Sum());
}](https://pbs.twimg.com/media/E0cuabxUYAMFV4h.png?name=small&format=webp)