Most active commenters
  • whizzter(3)
  • to11mtm(3)

←back to thread

.NET 10

(devblogs.microsoft.com)
489 points runesoerensen | 21 comments | | HN request time: 0s | source | bottom
Show context
jitbit ◴[] No.45888669[source]
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.

replies(26): >>45888799 #>>45888804 #>>45889332 #>>45891939 #>>45896032 #>>45898279 #>>45898305 #>>45898358 #>>45898503 #>>45898877 #>>45899062 #>>45899235 #>>45899246 #>>45899326 #>>45899445 #>>45899481 #>>45899858 #>>45900544 #>>45900791 #>>45900829 #>>45903218 #>>45904345 #>>45904435 #>>45905041 #>>45906073 #>>45907122 #
nicoburns ◴[] No.45900544[source]
> I wish .NET was more popular among startups, if only C# could get rid of the "enterpisey" stigma.

I tried .NET and liked C# as a language. But even though the language and runtime are now open source, it seemed like a lot of the recommended libraries were still commercially licensed, which was an immediate nope from me. I've never encountered that in any other ecosystem.

replies(12): >>45900964 #>>45901284 #>>45901414 #>>45903677 #>>45904049 #>>45904177 #>>45904488 #>>45907685 #>>45907873 #>>45908268 #>>45908319 #>>45908388 #
1. GiorgioG ◴[] No.45900964[source]
Recommended by whom? I've been doing .NET for 23 years (since the first beta) and I've never paid for a single library in any commercial project I've been part of.
replies(2): >>45901055 #>>45901101 #
2. runjake ◴[] No.45901055[source]
Not OP but I still run into paid libraries (eg Telerik) all over the place in projects.
replies(1): >>45904633 #
3. whizzter ◴[] No.45901101[source]
Moq, lots of PDF libraries, Avalonia, Automapper, MediatR, MassTransit,Telerik stuff,etc.

I'm not inherently against it, we have a problem with opensource being asymmetrically underfunded and if people going commercial is the cost perhaps we've failed.

replies(5): >>45901189 #>>45901335 #>>45901358 #>>45901359 #>>45907465 #
4. majora2007 ◴[] No.45901189[source]
There are a few non-paid PDF libraries, but that is the biggest pain point in .NET, anytime you need advanced features for PDF, you're better off paying for a license (it's just insanely expensive unless you're a large company).

Having worked on some basic parsing of metadata from PDF spec, I would rather pay than have to code something myself. PDF is such a PIA.

replies(1): >>45901616 #
5. paxcoder ◴[] No.45901335[source]
I can confirm that (several years ago at least) free PDF libraries were lacking, and Telerik was always non-free.

However, aren't Moq, Avalonia and MassTransit free software?

As for Automapper and MediatR, their owner changed from a free software license to only an open source one (Reciprocal Public License), but these are probably the simplest libraries of the ones you mentioned and have either been forked (MagicMapper) or have alternatives.

replies(1): >>45901510 #
6. ◴[] No.45901358[source]
7. paulirwin ◴[] No.45901359[source]
Avalonia is FOSS (MIT licensed). You only need Avalonia XPF if you are migrating legacy stuff.

Moq is largely unnecessary today with LLMs being able to easily generate mock classes. I personally prefer to hand-roll my mocks, but if you prefer the Moq-like approach, there's NSubstitute (3-BSD).

Automapper and MediatR are both libraries I avoided prior to the license change anyways, because I don't like runtime "magic" and not being able to trace dependency calls through my code. But, there is Mapster and Wolverine to fill those needs (both MIT). Wolverine can also replace much of MassTransit.

Telerik stuff - there are many good FOSS alternatives to these UI components; too many to list since it depends on which stack you're using.

PDF is indeed a sore spot. PdfPig is good, but limited in capability. I've started offloading PDF processing to a separate Python container with a simple, stateless Flask API with PyMuPdf.

> we have a problem with opensource being asymmetrically underfunded and if people going commercial is the cost perhaps we've failed.

Completely agree with this, though. My company and myself personally contribute a lot of time back to OSS, and I feel like that is part of the social contract of OSS. To have these libraries rug-pulled feels like a slap in the face as a OSS contributor and maintainer.

replies(2): >>45906476 #>>45906770 #
8. whizzter ◴[] No.45901510{3}[source]
Yeah pdf libraries are a bit of a mess, I work with a product that handles lots of PDF documents and I think we just recently added another PDF library dependency (I'm certain it's at least 3 now, but could be 4 or even 5 libraries loaded at startup).

Moq has the appearance of free software but bundled some spyware stuff (seemingly "benign" "Sponsorlink" for getting donations).

Masstransit went commercial recently, https://masstransit.io/introduction/v9-announcement

Avalonia itself is opensource, but i'd put in in a fremium/shareware category since if you need to add an WebView or Media player you need to buy their commercial Accelarate additions.

replies(1): >>45907704 #
9. jasomill ◴[] No.45901616{3}[source]
I've used libqpdf extensively from C++/CLI with excellent results, but since C++/CLI is deprecated-ish and Windows-only, I wouldn't disagree with PDF being a pain point, and if I get the time, a cross-platform open source .NET wrapper for libqpdf is at the top of my list of potential projects.

libqpdf also intentionally limits its scope to PDF structure, so doesn't address nontrivial content creation or manipulation (page content handling is pretty much limited to compressing/decompressing and parsing/unparsing the content stream).

replies(1): >>45904605 #
10. tracker1 ◴[] No.45904605{4}[source]
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.
replies(1): >>45906675 #
11. tracker1 ◴[] No.45904633[source]
I never liked their stuff myself, and generally avoided them.
replies(1): >>45908628 #
12. Kwpolska ◴[] No.45906476{3}[source]
I agree with almost all of this, especially MediatR being nonsense, but I would recommend against using a LLM to generate a mock. That’s just more code that you need to maintain and update on every interface change. NSubstitute is a fine library.

Another popular library that went commercial is FluentAssertions, Shouldly is a good open-source alternative.

13. whizzter ◴[] No.45906675{5}[source]
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 interfaces.

replies(1): >>45907154 #
14. AshleyGrant ◴[] No.45906770{3}[source]
Any recommendation of good alternatives to Telerik? We've been using it for years, but I'm open to considering alternatives even though it doesn't cost me anything to pay for the license.
replies(1): >>45907562 #
15. to11mtm ◴[] No.45907154{6}[source]
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.

16. piskov ◴[] No.45907465[source]
For pdfs render the, in html with razor and then print as;df with puppeteer. If you need custom headers/footers, add something like https://github.com/PejmanNik/puppeteer-report-csharp
17. to11mtm ◴[] No.45907562{4}[source]
Depends on what layer of Telerik [0]. Honestly of late since I'm extra rusty on frontend I just get Copilot with Claude to help generate UI widgets since that's allowed.

Before that, years ago, I just YOLOed with WebSharper and built composition helpers to make 'spartan but correct' UIs that could be prettied up with bootstrap if needed.

That said, alas, Bolero (what replaced WebSharper) is F# specific rather than also supporting C#.

I mostly bring those up because they have various libraries out there to work with different JS bits.

[0] - Cries in webforms

replies(1): >>45907916 #
18. to11mtm ◴[] No.45907704{4}[source]
> Moq has the appearance of free software but bundled some spyware stuff (seemingly "benign" "Sponsorlink" for getting donations).

Well they pulled back but the trust was broken in a lot of cases. I am still fine with it 'for now' but IDK NSubstitute always feels weird to me, maybe that's just how I was taught to use it tho.

> Masstransit went commercial recently

I mean good for them but thankfully it's also giving attention to other projects that are FOSS or Open Core...

As far as the other stuff, I've never seen AutoMapper used in a way that couldn't literally be handled with a static/extension method in 'real' code. Yes it can be useful but it is often grossly overused.

MediatR is cool but TBH I'd rather just reach for Akka.NET or MessagePipe instead; If you're abstracting out to keep processing backend 'swappable' you should be able to handle any of the above for the choice you make anyway.

19. AshleyGrant ◴[] No.45907916{5}[source]
We're planning on using Blazor, so any Blazor UI components that you recommend?
replies(1): >>45908639 #
20. runjake ◴[] No.45908628{3}[source]
Same here, but "enterprise" dotnet developers generally seem to need "more help" and love this kind of stuff.
21. naasking ◴[] No.45908639{6}[source]
MudBlazor is decent.