Live data from Hacker News

.NET 10

devblogs.microsoft.com

401–410 of 605 posts

Re: .NET 10

#401
post #2

For us, every .NET upgrade since .NET 5 has gone surprisingly smoothly and reduced CPU/RAM usage by 10–15%. We were even able to downgrade our cloud servers to smaller instances, literally. I wish .NET was more popular among startups, if only C# could get rid of the "enterpisey" stigma.

IMO, C# is just a somewhat better version of Java (low bar) w/ first class Windows API support. I can't see myself ever adopting it for any real work. F# on the other hand seems a pretty awesome, terse and expressive language. Unfortunately, it is very unpopular (yet still hangs around).

Re: .NET 10

#402

Earlier quoted context omitted.

Exactly this point. Go and Rust produce native binaries, I wish C# had an official native compiler without the big runtime needs of .Net.

You might want to read https://learn.microsoft.com/en-us/dotnet/core/deploying/nati... Publishing your app as Native AOT produces an app that's self-contained and that has been ahead-of-time (AOT) compiled to native code. Native AOT apps have faster startup time and smaller memory footprints. These apps can run on machines that don't have the .NET runtime installed.

Not every library is capable of building to Native AOT, which means any app that depends on those libraries run into the same problem. If the library or app uses reflection, it likely isn't capable of Native AOT compilation.

Re: .NET 10

#403

Earlier quoted context omitted.

AFAIK pinvoke (DllImport) works today just like it always has if you want to create FFI calls to C libraries. It's not windows only for sure.

That brings you back to managing memory though, C++/CLI having access to managed C# handles/references for GC'd objects (and finalization) would greatly simplify any memory management at the same time as having first class access to native libaries. Granted, one could probably build some of the machinery memory management in a simple way but it'd still need to be done and probably not be coherent with other native in…

IDK, for certain cases those fancy libraries are just handling the ugly marshal calls for you.

Wayyyy back in the day, before package managers were a thing, I had to write something to output a PDF via DLL calls and frankly it wasn't a bad experience. Possibly outside of what is in a 'modern' workflow but honestly wasn't too difficult. Just wrap it all in a class that only gives what you need and avoids potential footguns via validation.

Frankly it was easier than doing anything with Autocad's 'managed' libraries [0].

Maybe it's rose colored glasses for me, but .NET had fairly simple rules for most marshal bits so long as you knew them, although I will admit we didn't worry about 'performance' for the stuff I wrote and that can be a factor.

[0] - Microstation had a bunch of fancy COM hooks and exposed all of it to .NET in a nice way. AutoCAD 'managed' libs had all sorts of weird sorts of arcane rules and if you failed to follow them not only could you crash your .NET process but Autocad could remain unstable until you rebooted the PC... which is why I keep putting managed in air quotes.

Re: .NET 10

#404
post #122

What is the deal with Ubuntu and this version of .NET? Every since they got rid of the Microsoft packages feed, it's just been a complete mess. Ubuntu's own documentation states: > .NET 10 will be available in the Ubuntu archive for Ubuntu 24.04+ and included in main upon its official release But it isn't available?

Microsoft's Ubuntu image seems to be ready. I guess I could see a reason to use regular Ubuntu 24 and then install dotnet manually, but these images have served us well.

docker pull mcr.microsoft.com/dotnet/sdk:10.0 - Refers to Ubuntu 24.04 "Noble Numbat"

docker pull mcr.microsoft.com/dotnet/sdk:10.0-noble - Refers to Ubuntu 24.04 "Noble Numbat"

https://github.com/dotnet/dotnet-docker/discussions/6801

Re: .NET 10

#405

Literally just started building a game engine with .NET 9, so naturally there's an update within a week. -_- Seems like a good update, though! And I'm glad it's early enough that updating the framework probably shouldn't break anything. Really as long as there's no issues with the DearImGUI dependency (would be a surprise!), I'm pretty happy about the update.

For most projects, upgrading between .NET version is quick and painless, usually just updating the TargetFramework and NuGet packages in your .csproj file.

Re: .NET 10

#406

Earlier quoted context omitted.

Where is this worry coming from? (I'm curious, not shutting it down) I might be biased from having worked with production F#, but it feels more like functional is making its way into C#, as the general industry sees value in functional principles. So F# feels like its more here to stay?

They killed off VB, which if I recall the announcement correctly, noted that it statistically had a larger user base (by Microsoft metrics) than F#. There are a number of companies relying on F# for critical operations and MS has some use of F# internally which I understand has no plans of replacement, which helps balance out the fear.

I was curious so I googled. Best I can tell it is still supported, but perhaps stagnant?

Re: .NET 10

#407
.NET has to win the title for worst naming. If you didn't know what it was, this announcement makes no sense whatsoever. All you would guess is there are probably 9 others that were just like it.

Re: .NET 10

#408

Earlier quoted context omitted.

C# 1.0 was pretty much Microsoft Java, but since then, C# has evolved into its own, more powerful thing, while Java has stayed much more conservative over the years.

I'm not sure it is more powerful but it might be more ergonomic. The strange part about both (today - it made sense 20 years ago) is the whole bytecode thing. That should go away imo.

What’s wrong with bytecode? Using something abstract helps with porting between OSes and architectures. .NET supports compiling to native executables, but only a limited subset of projects is supported, because reflection is not available in native AoT mode.

Re: .NET 10

#409
post #388

Earlier quoted context omitted.

Silly question. If you want the C# experience but more community/OSS driven… why not Java?

I wouldn't call this a silly question at all. But having recently converted my intro data structures course from Java to C#, I can talk about why C# might be better. I have programmed regularly in both languages for the last 15 or so years (in addition to regularly programming in TypeScript, Scala, and F#). Java is fast and reasonably safe. It has a lot of software (especially OSS) software. Its package system (Maven…

> Generics work as you would expect with very few weird corner cases. No boxed types because... everything is an object!

Took me a moment to realize you meant that 'Java has corner cases because everything is an object' but yes.

Will also add the 'advantage' that for value types (i.e. struct) the generics are 'specialized' for the type, in certain cases you can use that for performance optimizations. (although it can have downsides.)

> The last two facts mean that you also get generic arrays, which are fantastic (and, incidentally, are also _implemented_ in C#, which is super cool)

And, fun side note, the generic arrays actually existed before real generics (and we get fun hacks in the VM as a result!)

.NET does still have funkiness around Array Covariance tho, which sometimes can be a pain.

> By default, reference types are not nullable.

This is a newer feature and great, however it requires people to (1) use libraries that properly do it and (2) requires you to have the right tag in the csproj to flag the NRT warnings as errors. I've yet to see a shop that has adopted (2) as a default.

> In general, the standard library is also better organized. Interfaces start with "I". Collections libraries have been carefully designed and learned many lessons from Java. A good example of an improvement over Java is the IEnumerable/IEnumerator class, which is simpler than Java's Iterator

Yes and also the sugar around yield syntax to do generators.

> Properties are really nice, and the shorthand syntax for property getters/setters saves a lot of time.

I still remember getting called into a Dev Manager's office, he's a JVM guy and he's goes into this overview of Lombok and how the JVM folks want to use it and he asks what I think and I'm like "Gee wow give me a moment I thought Java had AutoProps by now". (I think it was the first time he was impressed with C# as a language lmao, He and later I were disappointed in .NET's lack of a good set of thread pool abstractions...)

> .NET's runtime reflection capabilities are amazing. All of my autograders make extensive use of reflection instead of forcing students to compile with interfaces; this gives them a degree of freedom in implementing things.

That is so freaking cool and I love it. Profs like you made college fun back in the day.

> NuGet is a million times easier to use than Maven.

Truth; every time I have to do a thing in JVM dealing with maven feels like I need a goat or chicken to make anything work right.

> The downside is that C# is definitely not as fast as Java, in particular when the runtime is starting up. I remember how painful Java startup used to be, so I am optimistic that this will improve eventually.

We have AOT and R2R nowadays, I'm not sure if it's 'JVM Fast' for something like a webservice but unless you're pulling in something like an ORM it's typically fast enough I can't observe a difference as a user for utility apps/etc... Curious what examples you have in mind?

Re: .NET 10

#410
post #319

Earlier quoted context omitted.

> I wish .NET was more popular among startups, if only C# could get rid of the "enterpisey" stigma There are plenty of real issues that are not the enterprise stigma. I built a backend web api this year with it and C# is fantastic. EF Core is truly one of the best ORMs I've ever used. That said, I regret that decision and won't be using it again for any new projects. Honestly it looks like Microsoft is distracted and…

I had high hopes for Blazor but it didn't really materialize. Instead I'm just sticking with Angular. I don't think Microsoft doesn't know what to do with .NET. I think it continues on a very logical and direct path. But they have no idea what to do with UI on any platform. Luckily they haven't even deprecated any of the existing options and on the web, at least, you have all the same options as every other platform.

Blazor honestly is great for 'I need to write a simple backend control plane for whatever'. I.e. internal only stuff where you care about just shipping something functional and don't care too much how it all looks/etc.

Further you go away from that circle, the less enticing it is.

Post reply on HN