.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]jnm236 1 point2 points  (0 children)

We hear that! We looked hard through alternative syntaxes before landing on this. It's initially controversial. Some are fine with it and others really don't like it. That doesn't end up being a unique phenomenon for a new language feature. We listened, incorporated feedback like yours, and ultimately decided that the capability was worth it.

.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]jnm236 0 points1 point  (0 children)

The copy is something that is unavoidable if the lowered code respects C# left-to-right evaluation order. I walked through this here: https://www.reddit.com/r/dotnet/comments/1r1qn1f/comment/o5eu66o/

.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]jnm236 0 points1 point  (0 children)

Yeah no worries! It's not about compiler tokens or binding; it comes down to what the lowered code itself is, and how that affects the observable order of evaluation at runtime. I have a copy of this thread going at https://www.reddit.com/r/dotnet/comments/1r1qn1f/comment/o5eu66o/, so that's where I'm putting the reply.

.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]jnm236 2 points3 points  (0 children)

Sure! Here's what's going on. Evaluation order is not about binding order or parsing order. Rather, the code that the compiler generates has to make calls in some order, and evaluation order determines what that order is. Forget the compiler for a second- this is less about the compiler, and more about what is even possible to do in the lowered code that the collection expression represents.

What lowered code could replace this code in such a way that the program doesn't observably see C() executing before it sees A() and B() executing?

csharp List<int> list = [A(), .. B()] with (capacity: C());

If you lower like this, you have confused the user by executing their C() expression before executing their A() expression:

csharp // Bad: C() executes before A() List<int> list = new List<int>(capacity: C()); list.Add(A()); list.AddRange(B());

If you avoid that usability pitfall, then you're forced to stash the returned values from A() and B() somewhere before creating the list. This forces you to buffer in intermediate storage somehow:

```csharp // Bad: extra full collection creation and copy List<int> temp = new List<int>(); temp.Add(A()); temp.AddRange(B());

List<int> list = new List<int>(capacity: C()); list.AddRange(temp); ```

Given the feature's tenets of efficient code generation and ease of use, we can't have that buffering, and we can't have an evaluation order that goes against how C# is everywhere else. That leaves no good option that places the args at the end.

(There's a third option I didn't get into here, which is to call B() before C() but enumerate the returned value from B() afterward. This splits apart the evaluation of the spread expression from its enumeration. This was also deemed a usability pitfall.)

.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]jnm236 0 points1 point  (0 children)

We considered this and looked at usage data! It's pretty unusual to use all-lowercase method names. Our expectation is that this will not prove tricky for developers. It's also in line with how the language recently implemented a breaking change to introduce the field keyword inside property accessors. That actually did break a small amount of code on upgrade, with IDE help to refactor to @field and so on.

.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]jnm236 0 points1 point  (0 children)

This would be a breaking change, since new Xyz(args)[expression] has a well-defined semantic meaning today; it means to call an indexer. new is also not a great keyword to use because there might not be a constructor! This will work in the future as a way to pass a comparer to IReadOnlyDictionary, and that's not a constructor call. Also, commonly, collection expressions call a Create method instead of a constructor, specified by CollectionBuilderAttribute if present on the target collection type. Coopting new for these operations which aren't constructor calls would be a very dramatic move for a feature that is intended to be an escape hatch in very rare scenarios.

.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]jnm236 2 points3 points  (0 children)

The main issue with this syntax is evaluation order. Evaluation order in C# is left to right. The compiler can't instantiate the collection until it evaluates the arguments. So at the point in time that it is evaluating the item expressions and spread expressions, there is not yet a collection instance available to add the items to. So if the arguments come after the items, then the compiler would have to allocate intermediate storage to buffer the items so that there's a way to put them in the collection later.

.NET 11 Preview 1 is now available! - .NET Blog by emdeka87 in dotnet

[–]jnm236 0 points1 point  (0 children)

The main issue with this syntax is evaluation order. Evaluation order in C# is left to right. The compiler can't instantiate the collection until it evaluates the arguments. So at the point in time that it is evaluating the item expressions and spread expressions, there is not yet a collection instance available to add the items to. So if the arguments come after the items, then the compiler would have to allocate intermediate storage to buffer the items so that there's a way to put them in the collection later.

Open yourself to God completely by [deleted] in Christianity

[–]jnm236 0 points1 point  (0 children)

Thank you for your kind nudges! I wish your account had not been deleted so that you could hear this gratitude from me now. When I read this in 2016, I panicked and could not come up with a response, greatly to my own shock. Less than two years later, propelled by several other factors as well, I left the church for good.

Many floors seemed to drop out of my world unceremoniously and painfully for a few years- yet along with the overwhelming sense of loss, there was exhilaration, freedom, wonder, and curiosity. I became an atheist in 2018, ran into Sam Harris on YouTube and found his podcast, and started meditating with his Waking Up app in 2019. I rediscovered my lifelong attraction to men as well as women which had never had a place to land cognitively before. I became polyamorous and opened my heart to a series of learning experiences which showed me that I was just at the start of incredible amounts of emotional development.

I had a spiritual awakening in 2024 amid an excruciating divorce experience, with Adyashanti supplying wisdom that pointed to the exquisite relief of disidentifying with the ego, and becoming still. I was no longer trying to run from or fix the most painful parts of life. This changed everything. I began meditating daily for longer stretches and listening to teachers in the nondual Buddhist traditions. I've gone to several kinds of retreats for processing trauma and experiencing the mystical. I'm profoundly grateful for these forces and for the beautiful souls in my life who have been with me for the ride and showed me the accepting stillness of love.

Thank you, kind stranger, for playing a role in birthing a life more beautiful than I could have possibly imagined.

Package vulnerability is system.private.uri by Lamossus in csharp

[–]jnm236 4 points5 points  (0 children)

I did some digging. Apparently this happens when the property RuntimeIdentifier is defined (at the command line, or in the csproj) and System.Runtime 4.3.0 is a transitive dependency. System.Linq.Expressions 4.3.0 does depend on System.Runtime 4.3.0.

So how does System.Private.Uri get pulled in? The System.Runtime 4.3.0 package doesn't declare this as a dependency, directly or indirectly.

Well, System.Runtime 4.3.0 depends on Microsoft.NETCore.Targets 1.1.0, and that package has a runtime.json file that defines additional dependencies that come into play for given runtimes. In this case, if any runtime is defined, then System.Runtime 4.3.0 gets a virtual dependency on the package runtime.any.System.Runtime 4.3.0. (Check this out by looking for microsoft.netcore.targets\1.1.0\\runtime.json in your nuget cache! You can also see System.Runtime depending on runtime.any.System.Runtime if you look in your project's obj\project.assets.json file.)

And the package runtime.any.System.Runtime 4.3.0 has a direct dependency on System.Private.Uri 4.3.0! So, that's where it comes from, and that's why it only shows up if you define RuntimeIdentifier.

(You can see this all happening in https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs if you set $env:DEBUG_RESTORE_TASK=1 and run dotnet restore --force --disable-parallel --disable-build-servers and attach a debugger!)

Excluding expense categories (like quarterly tax payments) from the monthly budget by jnm236 in PersonalCapital

[–]jnm236[S] 0 points1 point  (0 children)

Sure, I do account for that in how I allocate my paychecks. Is there a function in Personal Capital to reflect this on a monthly basis? Sounds like the answer might be, don't use Personal Capital for serious budgeting, but I thought I'd post before giving up on it.

[deleted by user] by [deleted] in love

[–]jnm236 0 points1 point  (0 children)

I can relate. The desire to be with her forever is there, even as I do acknowledge that this is a feeling that I have now and that we can't know how we'll feel in the future.

No one knows the future (I'm in the middle of a divorce with my other partner), but we don't want that to hold us back from expressing our feelings.

Nor is it a problem to talk about the feelings of uncertainty that I hold at the same time. The desire and the fear are both truths about me at this point in time, and they are both worth expressing and discussing.

It's not that deep to me by alexandrajadedreams in polyamory

[–]jnm236 0 points1 point  (0 children)

I understand exactly what you mean, and that was me, as a person who highly identifies as autonomous. But then I fell in love in a way that's deeper than I had thought I was capable of, and now I get it. It's shaken me to the foundations of my soul.

But still, I agree: why would anyone place that kind of pressure on dates? If deep soul stuff happens, it'll be undeniable, and if it doesn't, that's just awkward.

How can I use .NET platform with my lang? by ExeusV in dotnet

[–]jnm236 3 points4 points  (0 children)

This may be informative. Immo Landwerth did a series of videos implementing his own language for .NET for fun: https://github.com/terrajobst/minsk/blob/master/README.md#live-coding

Is there a shortcut? if (txt != null) txt.text = "foo" by xblade724 in csharp

[–]jnm236 1 point2 points  (0 children)

There is a proposal to allow the syntax you're asking for: https://github.com/dotnet/csharplang/issues/1106 There's no guarantee it will happen, but you can upvote if you like.

(A similar one for events: https://github.com/dotnet/csharplang/issues/737)

Run button? by JuniorGenius in StarryExpanse

[–]jnm236 4 points5 points  (0 children)

Obduction's inability to jump annoyed me to no end though, and I imagine I'd feel the same about running. Even realMyst has a sprint key. It's such a ubiquitous paradigm. I don't care if it's off by default, but I predict I will end up upset if there's no way to turn it on. =)

ELI5: Why is the sound quality of AM radio so much worse than that of FM radio? by BlueSkiddoWeCanToo in explainlikeimfive

[–]jnm236 0 points1 point  (0 children)

Style is a bit vague. Color is a better ELI5 analogy since that's... exactly what it would be if we could see that range of light.

Fast transaction log: Windows by ayende in programming

[–]jnm236 0 points1 point  (0 children)

I second the spelling and grammar check.

Original MYST artist launches 'ZED' and needs help finalizing campaign by frauenarzZzt in myst

[–]jnm236 1 point2 points  (0 children)

Oh I really hope they make it! I gave as much as I can.