Sign in

Fati Iseni

@fiseni.com
1.1K followers 448 following 226 posts

Software Engineer | Microsoft MVP | .NET fiseni.com

PostsRepliesMedia
Fati Iseni @fiseni.com · 10/04/2026
I was holding a demo on structs. No surprise new devs are confused with all the concepts. readonly, ref, in, record struct.. 🤯 Btw, using the `ref` keyword to mark that struct can't live in the heap is the most counterintuitive term ever.
010
Fati Iseni @fiseni.com · 31/03/2026
Ok, this covers it better. Actually, no need to correlate Customer.Id with Address.CustomerId. It's enough to have unique strings per scope.
000
Fati Iseni @fiseni.com · 31/03/2026
I quickly created this converter now. Not optimized, but just as POC. Is there an easier way? Or custom converter is the way?
100
Fati Iseni @fiseni.com · 24/02/2026
I'm playing with extension properties, and I'm curious why overloading is not allowed. It works just fine for methods. #csharp #dotnet
000
Fati Iseni @fiseni.com · 31/08/2025
Btw, I noticed one peculiar issue. It seems the RSA is cached in RsaSecurityKey. If you re-create a new instance, it will fail during validation. Here is a simple example. If I disable the CacheSignatureProviders, then works each time. Not sure why is cached, but finding the root cause was tedious.
100
Fati Iseni @fiseni.com · 22/08/2025
It seems, the closure instances are always set at the top of "locals init" section, regardless where do they appear. And that's the thing I didn't know until today, after 20 years :)
130
Fati Iseni @fiseni.com · 22/08/2025
Here is even more simple example. In case of min = negative number, how much do you think the Run would allocate? You'd expect no allocation, but it will allocate for the closure (the DisplayClass).
110
Fati Iseni @fiseni.com · 22/08/2025
Here, I reproduced it in a simple example. Anyhow, lesson learned. Never assume an "unreachable" code won't have any effect.
151
Fati Iseni @fiseni.com · 22/08/2025
Yep, it does the instantiation at the start of the method. What the hell? Why? This makes me re-evaluate my life :)
110
Fati Iseni @fiseni.com · 22/08/2025
It's a closure, actually. I really have no idea why it would instate it beforehand.
110
Fati Iseni @fiseni.com · 22/08/2025
None of the code will run. The first if covers all cases. Here, I fixed the issue by just creating a local function. Now I'm back to 0 allocs. It's weird. It means some of the closures of the dead code were instantiated somewhere at the beginning of the method? That breaks all my assumptions :)
110
Fati Iseni @fiseni.com · 22/08/2025
Ok, this caught me off guard. In our benchmarks, this section is dead code but adds allocations. If I comment out that section, I have 0 allocs. How does this unreachable section affect that? #dotnet #csharp
240
Fati Iseni @fiseni.com · 13/06/2025
I'm reading this spec. Yea, it's a bit fuzzy. There are some conflicting information. learn.microsoft.com/en-us/dotnet...
000
Fati Iseni @fiseni.com · 13/06/2025
Who can shed some light here? What's the rationale for allowing internal methods in the interfaces? Once you have an internal method, consumers can no longer implement that interface. If they do not include it in their impl, it's a compiler error. But they can't include it either. #dotnet #csharp
130
Fati Iseni @fiseni.com · 13/06/2025
To try out the experience, for the whole week, I've been requesting PR reviews from Copilot on GitHub. While it can find some stupid and easy mistakes, for more complex code just spits out nonsense.
120
Fati Iseni @fiseni.com · 03/06/2025
How many more modifiers can we have? #dotnet
100
Fati Iseni @fiseni.com · 27/04/2025
Ok, I just sat down to sketch something quickly now. The idea would be to just install a NuGet dev dependency, and you'll be able to use Merge tags to indicate that deps should be merged to the current assembly. This is just the initial thought, still working on the idea.
100
Fati Iseni @fiseni.com · 02/04/2025
I have zero grudge or anger towards the authors. Neither I think there is "rug-pulling" or whatever. I think the .NET Foundation should be reformed and have a different role in the ecosystem. Here are my thoughts posted as a picture :) #dotnet
040
Fati Iseni @fiseni.com · 21/03/2025
Ok, I never bash people for sharing stuff, but this is really getting out of hand! What is this for the love of god? And hundreds of people chearing this post. #dotnet
340
Fati Iseni @fiseni.com · 09/03/2025
I've been using a bash script for a long time. Having a dotnet tool would be more convenient.
010
Fati Iseni @fiseni.com · 13/01/2025
Just for fun, I rewrote the implementation in C. Finally under 1 second (down from 42 minutes originally).
2102
Fati Iseni @fiseni.com · 09/12/2024
Sorry pal, but this is not correct and it's not a good advice. Yes, it should be used instead of .Result, but it doesn't save you from deadlocks. All it does, is to properly unwrap the exceptions.
140
Fati Iseni @fiseni.com · 23/11/2024
I was just scrolling through X now, and it feels cringe, at best. This is how my timeline looks like. One man show 🤷‍♂️
130
Fati Iseni @fiseni.com · 17/11/2024
Comments for sure have value, as long as they describe the "why" or in cases where there is some subtle background story. Here is my example.
010
Fati Iseni @fiseni.com · 17/11/2024
Going through the code now, and here is a simple example. The trimming might remove the interfaces here. So, you might need [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] here But I'm in doubt too. Should we even do it for these types of libraries? I don't know.
210
Fati Iseni @fiseni.com · 16/11/2024
I just found this. Almost 20 years ago, before a Megadeth concert. Damn, I got old.
130
Fati Iseni @fiseni.com · 16/11/2024
And they support all in this list. What sorcery is this?
110
Fati Iseni @fiseni.com · 14/11/2024
If you have a concrete collection, here is an allocation-free approach for GroupBy. It's quite verbose code, but it removed tons of allocations. #dotnet #aspnetcore
2132
Fati Iseni @fiseni.com · 14/11/2024
I do get it, I'm just being overdramatic here :) But I would lie if I said I love netstandard. The issues in old platforms are still present.
110
Fati Iseni @fiseni.com · 11/11/2024
I was using AI to generate cover images, and give appropriate credit :) But I have to stop doing that too. It looks weird.
000
Fati Iseni @fiseni.com · 10/11/2024
This is my favorite use of collection expressions. I find myself using it all the time. What would have been multiple statements or annoyingly a long one; is perfectly succinct now. #dotnet #csharp
2282
Fati Iseni @fiseni.com · 10/11/2024
I just got a notification that you followed me there. Perhaps some automated actions. Just wanted to let you know.
110
Fati Iseni @fiseni.com · 26/10/2024
Do not access instance fields in tight loops. Create a local variable instead. See the difference in this example? Foreach does that for you automatically, so perhaps you're better off using foreach nowadays. #csharp #dotnet
000
Fati Iseni @fiseni.com · 24/10/2024
I wish we could do this in #csharp Overlapping value types and references in the same offset. I understand that GC needs to differentiate it. Perhaps some attribute for Type so its values can act as a discriminator? Wishful thinking only :) #dotnet
031
Fati Iseni @fiseni.com · 22/10/2024
How much memory do you think this simple expression consumes? Answer: 600 bytes 🤯 #dotnet
100