News for hackers. Stuff that matters.
Re:How Async/Await Works in C# by Waterluvian on Saturday March 18, 2023 @07:45AM (#35208250)
I got rabbit holed by the first sentence. I use .NET so sparingly that I can’t seem to ever develop a full grokkin’ grasp of what the heck “.NET” is at any given time.

It’s not .NET Framework anymore. Or .NET Core. And it’s none of the countless random things Microsoft has labelled .NET. I think the name fundamentally misleads my brain every time given it’s not necessarily a web framework. I need .NET runtimes for my video games.

So it’s basically a managed group of tools and libraries to let you build stuff in a handful of different languages, usually C#, but targeting the same runtime, which is a JIT? So is it basically like Java but with far too much marketing involvement over the years?

Re:How Async/Await Works in C# by thatjoeoverthr on Saturday March 18, 2023 @07:53AM (#35208296)
This reminds me of my experience developing for Windows Phone. There were something like three or four distinct frameworks with nearly identical names. It’s already hard enough to google anything, and now you have your platform vendor running interference against you.
Re:How Async/Await Works in C# by grugagag on Saturday March 18, 2023 @08:20AM (#35208477)
I share the sentiment. Microsoft has done an atrocious job at naming things here and created a lot of confusion.. Im not sure if this was their intended goal or it’s simply incompetence.
Re:How Async/Await Works in C# by becquerel on Saturday March 18, 2023 @08:46AM (#35208645)
The branding is really awful, yeah. .NET in its broadest sense is Microsoft's home-grown programming stack. This includes a runtime (the 'Common Language Runtime') which different languages target. The big one is C# but there's also F# and a few weird experiments which didn't pan out.

It all started with '.NET Framework', which was the old Windows-only implementation. Eventually they rewrote everything to be cross-platform and called it '.NET Core'.

Distinguishing between the two was confusing, so MS took the genius decision of rebranding it all as just '.NET'. So today you can make a project in .NET 5, .NET 6, .NET 7, etc., and they're all cross-plat.

Various frameworks exist on top of .NET. The biggest one is ASP.NET Core, the web framework. And there's frameworks on top of that like Blazor.

The runtime is JIT by default, but you do actually have AOT options nowadays, which is nice.

Re:How Async/Await Works in C# by bazoom42 on Saturday March 18, 2023 @08:58AM (#35208724)
Yes, in practice it is Microsofts Java: A virtual machine, a set of libraries, and a set of languages (C#, VB.net, F#).
Re:How Async/Await Works in C# by skneko on Saturday March 18, 2023 @09:01AM (#35208742)
For your information, in the Java world the equivalent of .NET is called JRE (Java Runtime Environment).
Re:How Async/Await Works in C# by eropple on Saturday March 18, 2023 @10:25AM (#35209381)
Historically maybe-sorta; the consumer download for Java used to be called the JRE. It hasn't been updated since Java 8. .NET ships with a pretty full toolkit even on consumer systems (it's what undergirds PowerShell too) so .NET probably maps better to the whole-hog JDK.

The JRE-equivalent in the .NET stack is the Common Language Runtime. The JRE processes Java bytecode; the CLR processes Common Intermediate Language (CIL, formerly MSIL) instructions.

Re:How Async/Await Works in C# by partomniscient on Saturday March 18, 2023 @09:26AM (#35208947)
>I can’t seem to ever develop a full grokkin’ grasp of what the heck “.NET” is at any given time.

Even those the work at Microsoft haven't been able to work that out since they coined the term, let alone developers etc.

Re:How Async/Await Works in C# by tester756 on Saturday March 18, 2023 @09:30AM (#35208994)
.NET is an ecosystem,

an ecosystem made of languages, compilers, runtimes, libraries, tools and community.

Re:How Async/Await Works in C# by highwaylights on Saturday March 18, 2023 @10:24AM (#35209371)
Not really.

.NET Framework is analogous to the JVM.

Micro-frameworks that don’t pack the kitchen sink like nodejs became popular, so Microsoft made .NET Core to be philosophically similar to that.

Because people such as yourself got confused by this, they eventually stopped pushing Framework and renamed .NET Core to .NET.

Microsoft has never been popular with the valley crowd, so everything they have ever done is pooped on constantly by people on here.

You should check out some of the posts on here when VS Code came out. A lot of people were amazed that Microsoft had built something decent “out of nowhere” like those people hadn’t just been living in a bubble their whole career.

Re:How Async/Await Works in C# by KronisLV on Saturday March 18, 2023 @12:12PM (#35210262)
> .NET Framework is analogous to the JVM.

Wouldn't CLR be closer to JVM? https://learn.microsoft.com/en-us/dotnet/standard/clr

And then... I don't know, .NET Framework to JDK, or something like that?

I like the whole thing (since .NET now runs on Linux well enough, C# feels okay as a language and has good tooling, like Visual Studio or JetBrains Rider) but there's definitely some naming and branding confusion sometimes going on, including in my own head.

Re:How Async/Await Works in C# by dragonwriter on Saturday March 18, 2023 @12:45PM (#35210639)
> .NET Framework is analogous to the JVM.

No, its the library, not the runtime.

> Micro-frameworks that don’t pack the kitchen sink like nodejs became popular, so Microsoft made .NET Core to be philosophically similar to that.

.NET Core was still a very batteries-included library, it just dumped bits tied to Windows and made some other backward-compatibility sacrifices to get something cross platform and open sourcable.

> Because people such as yourself got confused by this, they eventually stopped pushing Framework and renamed .NET Core to .NET.

IIRC, they announced the long term plan to move all functionality that would be retained into Core and converge on a single implementation fairly early on, but to move forward in parallel until then .NET Standard versions were created to identify compatibility across Core and Framework during this period.) Dropping Framework and making Core just unqualified . NET (and eliminating the need for Standard) was just the completion of that strategy.

Re:How Async/Await Works in C# by sn_master on Saturday March 18, 2023 @10:39AM (#35209471)
> but targeting the same runtime, which is a JIT?

Except you don't need anything .Net specific to be installed on the end user machine. I build and deploy single-file C# binaries to Linux all the time. There's no longer a dependency on having the .Net framework installed or having dozens of DLLs accompanying your binary.

Re:How Async/Await Works in C# by thomk on Saturday March 18, 2023 @11:01AM (#35209632)
Is that the point of .Net Core? No platform specific dependencies required?
Re:How Async/Await Works in C# by SideburnsOfDoom on Saturday March 18, 2023 @01:26PM (#35211132)
sn_master is talking about a "single file deployment" that does not need an existing shared runtime present on that target machine (or container). But which is platform-specific.

This is an orthogonal concern to running on Linux, Which could depend on a shared runtime, or not.

Which does .NET do? all of the above.

https://learn.microsoft.com/en-us/dotnet/core/deploying/

Re:How Async/Await Works in C# by SideburnsOfDoom on Saturday March 18, 2023 @01:20PM (#35211053)
> So it’s basically a managed group of tools and libraries to let you build stuff in a handful of different languages, usually C#, but targeting the same runtime, which is a JIT?

This is not wrong.

.NET Framework = the built-in class libraries. Confusingly, also .NET Framework can mean the older, legacy, Windows only version of the whole thing.

NuGet = package management for built-in and 3rd party libraries.

Roslyn = the C# compiler

MSIL: the bytecode "Intermediate Language" emitted by that compiler

CLR = Common Language Runtime for MSIL, and related concerns such as GC and JIT

C# a general purpose language, OO-first but with some functional things.

The other problem is that it's broad: a person can use C# and.NET for one thing (e.g. Web services, or Desktop GUIs), and have strong opinions about what's needed and how to do things, and assume that this is universal but ... it isn't true of the other.

Re:How Async/Await Works in C# by solarkraft on Sunday March 19, 2023 @11:02AM (#35219669)
It is .NET Core. People still use that term to refer to the "new age" .NET occasionally. The name "dotnet" is also used for this form of .NET more often.

Yeah, it's confusing. Took me some work to get through too.