Great interview but I wish that there was a side view where an example was showed for every topic and example that was talked about to make it easier to follow. You two are the absolute experts in this but for somebody learning it would be a great way to learn.
The biggest problem with nullable reference type is that the compiler won’t detect that properties/fields are initialized in a method called by the constructor. Instead I have to add MemberNotNull attributes to the initialization routines.
@ that could work for field but you can’t use a property as an out parameter. The real point is that the compiler could easily analyze the initial methods to calculate what is guaranteed not to be null. It would only have to do this for methods called from constructors
@@DanGolick "... the compiler could easily analyze the initial methods to calculate what is guaranteed not to be null." No, it really could not. Doing so would be equivalent to solving the halting problem.
@@DanGolick No, it really cannot. There is no limit to the complexity of a method call. Whereas in a constructor, it can tell if a value is assigned or not - that's the limit of what it can determine.
The STS / LTS version mismatch thing doesn’t make much sense as an argument. If your company has a “LTS-Only” policy, you’ll be on .NET 8 and v8 packages until .NET 10 comes out. If they don’t have that policy, then you can use .NET 9 with v9 packages. And even if that very unlikely scenario of .NET 8 with v9 packages occurs, .NET 10 will come out before .NET 9 is out of support. So no matter the policy, there’s always a version you can upgrade to.
As with anything, functional programming doesn't have to be difficult. In companies that rely on functional programming, they will naturally write code that's more complex, but the very fundamental concepts in functional programming, like immutability and function purity can be very helpful when combined with OOP. Zoran Horvat makes some very interesting videos about those challenges.
@@fusedqyou Just because you don't like his approach don't mean he does "the opposite of easy", although easy is a pretty weaponized word anyways in programming (along with 'simplicity')
using System.Runtime.InteropServices; public enum Kind : int { isX, isY, isZ }; [StructLayout(LayoutKind.Explicit)] public struct OneOf { [FieldOffset(0)] public Kind kind; [FieldOffset(4)] public X x; [FieldOffset(4)] public Y y; [FieldOffset(4)] public Z z; }
Mads Torgersen and the way he talks about the language gives me confidence that this language has a future.
Place your bets which one is coming first
1. C# discriminated unions
2. Java string interpolation
3. GTA 6
3
3
1
3
Great talk. I really like the laid back approach in these videos. Thanks for the great work!
Great interview but I wish that there was a side view where an example was showed for every topic and example that was talked about to make it easier to follow. You two are the absolute experts in this but for somebody learning it would be a great way to learn.
The biggest problem with nullable reference type is that the compiler won’t detect that properties/fields are initialized in a method called by the constructor. Instead I have to add MemberNotNull attributes to the initialization routines.
How about call the method like this "init(out MyProperty1, out MyProperty2)"? I think "out" operator will solve that warning.
@ that could work for field but you can’t use a property as an out parameter. The real point is that the compiler could easily analyze the initial methods to calculate what is guaranteed not to be null. It would only have to do this for methods called from constructors
@@DanGolick "... the compiler could easily analyze the initial methods to calculate what is guaranteed not to be null."
No, it really could not. Doing so would be equivalent to solving the halting problem.
@ if it can do it for the body of the constructor it can do it for a method call
@@DanGolick No, it really cannot. There is no limit to the complexity of a method call.
Whereas in a constructor, it can tell if a value is assigned or not - that's the limit of what it can determine.
1:22:36 gave his best Anakin impersonation
1:29:55 nullable ref types are a pain... until u realize u dont need to null check everywhere!!!
14:15 on var ... wow
field operator.
Available in 13-preview. Plan to be released as part of C#14.
The STS / LTS version mismatch thing doesn’t make much sense as an argument.
If your company has a “LTS-Only” policy, you’ll be on .NET 8 and v8 packages until .NET 10 comes out.
If they don’t have that policy, then you can use .NET 9 with v9 packages.
And even if that very unlikely scenario of .NET 8 with v9 packages occurs, .NET 10 will come out before .NET 9 is out of support.
So no matter the policy, there’s always a version you can upgrade to.
I've never clicked on a video so fast
1:22:40 yessss delegates are the worst
Do you still do podcasts?
Please do some more
This is a podcast
@@nickchapsas haha
@@nickchapsasmy Bad, I was referring to the “Keep Coding” podcast
It's the same thing, it's just on the main channel now
24:00 haha, one sec just going to raise a PR at work
Nice talk 😎
Mad lad
There's something wrong with the sound, it's terrible to listen.
Yeah I tried to fix it in post but that's the best I could do. I messed up the lav mic balance
Lol it's not that bad dude 😂
Its doable - just not excellent - no sweat !!
var wars inside MS )
Mads looks to me like a bit blurry person)))
U last!
KEEEEEEEEEEP C# easy!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Don't destroy C# like C++!!!
As with anything, functional programming doesn't have to be difficult. In companies that rely on functional programming, they will naturally write code that's more complex, but the very fundamental concepts in functional programming, like immutability and function purity can be very helpful when combined with OOP. Zoran Horvat makes some very interesting videos about those challenges.
@@JansthcirlU You can use F# if you want functional programming!
@@JansthcirlU If there's somebody who does the opposite of easy it would be Zoran Horvat.
@@fusedqyou
Just because you don't like his approach don't mean he does "the opposite of easy", although easy is a pretty weaponized word anyways in programming (along with 'simplicity')
bot.
using System.Runtime.InteropServices;
public enum Kind : int { isX, isY, isZ };
[StructLayout(LayoutKind.Explicit)]
public struct OneOf
{
[FieldOffset(0)] public Kind kind;
[FieldOffset(4)] public X x;
[FieldOffset(4)] public Y y;
[FieldOffset(4)] public Z z;
}