Live data from Hacker News

.NET 6 Released

devblogs.microsoft.com

301–310 of 428 posts

Re: .NET 6 Released

#301

Earlier quoted context omitted.

They got type generators which somewhat influenced and predates the Source Generator feature by a few years. Not the same thing of course, and from what I've seen are slightly different in target/scope. (e.g. F#'s seems more appropriate for scripting where you can use it without a proj entry).

Do you mean type providers? That's their own type of nice thing but to your point it is only for generating types, source generators can generate much more than a basic type. Also I swear I saw somewhere type providers were not functioning as well in newer .NET but that was hearsay as I never tried them in 5 and now 6.

They are working in .NET 5 last time I checked. Opened an FSX script, "#r: nuget SwaggerProvider", point to a JSON API and it seems to work with IDE auto complete included with 2 lines of code, no project scaffolding, or package manager files required. Things seem to be improving on this front I guess as well.

I do agree - source generators have a better API as an implementer and can generate more than classes. I guess as soon as I need to jump into a proj file and I'm working with MsBuild anyway what stops me creating my own generation framework that runs before PreBuild that generates code for my compile step? I've done it before source generators were a thing.

I also did a quick Google search - Myriad (F# library) might be something that does something similar.

Re: .NET 6 Released

#302
post #90

Earlier quoted context omitted.

IMO Java/.NET just don't get blogged about _on this site_. If you visit /r/Java, /r/dotnet etc, you'll actually find the content about them.

Getting blogged on this site is the goal. Getting blogged on a site that is dedicated to that tech is not noteworthy. You can find such blogs or forums for every obscure language that has more than a 1000 users.

Java and dotnet aren’t obscure languages. Java’s user base is larger than anything on _this site_. Java bloggers also know that HN isn’t their target audience because they know HN is biased. It’s a much more worthy investment to reach the actual community who are going to come back to your site and actually discuss your content.

Re: .NET 6 Released

#303
post #50

Earlier quoted context omitted.

>, but it feels like my peers at university and in the industry tend to stay far away from .NET for personal projects, etc. Why is this? It's leftover industry bias because of Microsoft's long history of a proprietary tech stack that costs money to use. Today's Microsoft of promoting open source VSCode doesn't really undo the mindshare they lost in the 1990s and 2000s when the internet got big. I wrote previous comme…

A part of this is that MySQL can have read only scale-out replicas for zero additional licensing cost. You pay only for the hardware. In Microsoft Land, the SQL Server team considers this an Enterprise feature, which basically translates to: "We added a couple of zeros to the price". THIS, I feel, more than anything, meant that the Microsoft stack was just a dead end for many startups. The licensing cost for the data…

Into Oracle? Isn't it also expensive?

Re: .NET 6 Released

#304
post #34

As a relatively new engineer (~2 years FAANG experience), there seems to be a connotation around .NET. Perhaps this is indicative of the larger Microsoft ecosystem, but it feels like my peers at university and in the industry tend to stay far away from .NET for personal projects, etc. Why is this?

I can chime in on this one. I think it's very much a 'culture' thing. So, I'm a *nix guy. You know, running Sway WM, using Doom Emacs as my daily driver, that sort of a thing. Learned vim to write my thesis at night on an armchair where using the mouse was not comfortable. Not long ago I accidentally got involved with a kind of a .NET consulting gig. Rather, I got involved as a domain expert to help out some SaaS sta…

> But I won't be looking for .NET jobs

Have heard this sentiment in more than one comment in places like HN. "The {tech} is great, but the culture was ... so I'm not putting {tech} on my resume". And So it becomes a self-fulfilling prophecy :). Yet some tech seem immune to this. They don't say "X is great but the culture was crap, so I'm abandoning X", they say "X is great but the culture was crap so I'm changing jobs".

It really drives home that culture is critical, and even the worst tech can be tolerable if it is thought of as cool. Though of course the thought of abandoning ship to learn the latest and greatest solely to avoid legacy C++98/Spring/WebForms/whatever is naturally appealing.

Re: .NET 6 Released

#305

Earlier quoted context omitted.

A part of this is that MySQL can have read only scale-out replicas for zero additional licensing cost. You pay only for the hardware. In Microsoft Land, the SQL Server team considers this an Enterprise feature, which basically translates to: "We added a couple of zeros to the price". THIS, I feel, more than anything, meant that the Microsoft stack was just a dead end for many startups. The licensing cost for the data…

Into Oracle? Isn't it also expensive?

I mean that Oracle is even more fantastically expensive, and the SQL Server team wants the charge a comparable amount. They're slowly but surely working up to that level...

Re: .NET 6 Released

#306
post #163

Earlier quoted context omitted.

No passable debugger, weird typing system, verbose error handling, lack of exceptions, generics, syntactic sugar ... I'm a novice at Golang, and I dislike much of the language, except that it's fast and can produce small binaries.

"verbose error handling, lack of exceptions" Exactly why I prefer Go to Java and C#.

I can live with many things, but no generics in 2021? Over my dead body!

Re: .NET 6 Released

#307

Earlier quoted context omitted.

The .NET people were likely right in your case. In C# structs are allocated on the stack, that's why you'd use them. Unless you have a specific reason you'd generally keep pure data objects as classes and not structs. And there can certainly be a culture clash, there is a bit of a tendency towards more complex patterns in the .NET world. But you don't have to do that, and MS is quite explicitly adding versions with l…

Just re-read C# documentation and remembered the situation more clearly. Basically, I consciously researched the differences between class and struct in C# beforehand. And decided to use struct as the 'thing' was a kind of a coordinate that would be instantiated a lot for simple coordinate-space transformations, so it made sense for it to actually be a value type. I should've been more assertive about it. Well, worst…

Just to add some context. Another commenter mentioned gotchas that would make C# developers weary.

The fist that comes to mind is that with a class invariants of the type can be ensured in the constructor or by making the constructor private and exposing static factory methods. A struct, on the other hand, is always simply declared, so don't afford these protection measures. For some reason C# still supports constructors in structs though, and even uses the `new` keyword to invoke them. This creates a kind of trap where structs almost, but not quite, behaves like classes.

Another gotcha is the defensive copy semantics. When a method is invoked on a struct, and that struct is a readonly field, a copy of the struct is created for the method to avoid mutating the field. This is not at all how classes referenced by a readonly field behaves.

I guess the same can be said for the simpler case of just passing a struct as parameter to a method mutating its now local copy. Again different outcome for structs and classes.

Since the code look so similar (its just a different keyword at declaration site) it creates an uncanny valley tripping people up. Not least when refactoring between the two. After all, being a language with a GC means memory layout is seldom a primary concern for people.

However you can now declare structs readonly to avoid the defensive copy thing, or as a ref-struct to retain mutability, almost like a class. And as long as the default value is perfectly valid, like say (0,0) there shouldn't be much surprises anymore.

Re: .NET 6 Released

#308
post #5

.NET 6 seems like a pretty good release with a few cool new features. But it's funny how the infographic in the post mentions MAUI for desktop development, but the "desktop" keyword in the text is referring to the WinForms github repository. I can't think of a more concise statement about the state of GUI development on .NET. I would really wish for less fragmentation and churn in that space.

My strategy for dealing with Microsoft's regrettable desktop GUI roadmap is to use the web as much as possible. .NET has an incredible suite of features for pushing functionality to the browser. Kestrel is one of the fastest web servers available today. Developing directly against the AspNetCore pipeline has a bit of a learning curve, but it becomes very intuitive once you get over the DI/startup hard bits, and the p…

"I would go so far as to argue for deployment of a self-contained webservice to the end users that could be accessed via any arbitrary localhost browser"

Might as well use Unity game engine and write your app inside one.

Re: .NET 6 Released

#309
post #34

As a relatively new engineer (~2 years FAANG experience), there seems to be a connotation around .NET. Perhaps this is indicative of the larger Microsoft ecosystem, but it feels like my peers at university and in the industry tend to stay far away from .NET for personal projects, etc. Why is this?

For the same reason there's no "M" in FAANG. This industry has PTSD from the old Microsoft of the 1990s and 2000s, and isn't open to giving the new .NET a chance. It's a shame really, as the modern .NET stack / tooling / ecosystem is probably one of if not the best there is (at least for general purposes).

Re: .NET 6 Released

#310
post #239

Earlier quoted context omitted.

Yeah .. but there is one aspect in this argumentation: C# is everywhere a reasonable contender. So while you rarely get a dominant position (Unity and Backends) you get a lot of second places (Apps, Desktop, ...) which complement your full stack experience in an awesome language. And this is different to other languages: Python/Go: no-show in apps; JavaScript: no-show in data science; Swift: no-show in backends (than…

>From a management perspective, this is not bad. You get movable team members. I have a friend-of-a-friend who has a successful 30 person contracting business. They do C#. He , the co-owner benefits from this. I was responding to a question from a FAANG developer. FAANG developers don't get moved. FAANG developers move when they want to move: to projects that they find interesting; to other FAANGs; or to start-ups. A…

I honestly don't have first hand experience, but I seriously doubt every FAANG developer is the rock star you're making them out to be. I'm sure there are certainly plenty of FAANG developers working on boring shit that needs to get done.
Post reply on HN