Live data from Hacker News

.NET 10

devblogs.microsoft.com

511–520 of 605 posts

Re: .NET 10

#511

At last, extension properties in C#. I’ve been waiting for these for years.

Why is it better than just using a method?

Think of it in terms of semantics. An object has certain properties that are immediately obvious and available: color, height, width and so on.

Properties in C# are for such values that are immediately available or at least extremely cheap to retrieve or form. Seeing a property tells me that getting the value is a very small op and has no side effects.

A method on the other hand is like asking/telling the object to do something that can take a bit of time and resources to do.

So if the value you are trying to read is expensive to get and isn't immediately available then the method approach works and as a developer I'll avoid making multiple calls to it unless absolutely necessary because the method is also a possible indication that it might change state.

Re: .NET 10

#512

Earlier quoted context omitted.

> 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.

What is wrong with paying for something that is useful?

Seems like many people are just coding as a hobby? Idk. I want to make money writing software and so I pay for libraries that solve a problem for me.

I expect the baker who sells me his bread pays for the flour.

Re: .NET 10

#513
post #99

Updated a pet project of mine and got a minor break: var pixels = new uint[renderers.width * renderers.height]; var pixels2 = MemoryMarshal.Cast (pixels); pixels2[idx] = ... In NET9.0 pixels2 were Span , but in NET10.0 a different MemoryMarshal.Cast overload is used and it is ReadOnlySpan now, so the assignment fails. Spans is such a fundamental tool for low level programming. It is really unfortunate they were added…

NHibernate project stumbled upon much bigger break: https://github.com/nhibernate/nhibernate-core/issues/3651#is...

We force to use this workaround for now.

Re: .NET 10

#514

Earlier quoted context omitted.

C# is massive in (mobile) gaming because of Unity. And when the front-end is C#, it only makes sense to do the backend in .NET too so you can share classes easily.

I only partly agree with you... if you're talking a web api, then code generation can go a long way with an OpenAPI doc file.

Yea, but then the other end has to serialise the HTTP API stuf to a typed object on their end.

It's a lot easier when you have a single shared library you can just NuGet into both sides, client and server and then use the same correctly typed PlayerDTO for both.

Re: .NET 10

#515
post #292

Earlier quoted context omitted.

Might be my own taste, but except a few of the common and easy to understand structural typing code, I find it sometimes actually make things needlessly complex. I also write lots of Typescript, and the furthest I go is to use 'Omit' and other utility types, but already feel like it's too much.

I've come to really appreciate Typescripts structural typing, because it reduces some of the overhead & prevents the unnecessarily tight coupling that has often annoyed me in other languages. The overhead argument seems fairly objective to me - clean code with low coupling in C# et al. requires separate definitions of interfaces and implementations, explicit conversion methods between compatible interfaces etc. This…

It prefer static functions and stuff we can quickly understand, avoiding big objects or a great deal of indirection. Don't tell Uncle Bob!

Of course, you'd still need interfaces for DI, mocking etc, but that's pretty most of my interface usage.

Re: .NET 10

#516

Earlier quoted context omitted.

??? Java was originally Sun Microsystems. However - if Java was Oracle to begin with (and as successful in the mid-90s) then might have done some marketing for the Java+Oracle mix. Some people (ie Managers) if they decide on using Microsoft products will likely "encourage" the use of C# and .NET. -- That is an example of C# + Sql Server.

> That is an example of C# + Sql Server. I'm sorry but most of us use Npgsql now

Good -- so am i

Re: .NET 10

#517

Earlier quoted context omitted.

Evaluating complex expressions during debugging. In c# I can evaluate complex linq data transformation in watch window in visual studio during debug, at fly. In cpp I cannot. Not even nested evaluation is working.

Ah okay, yes, debugging tools are a bit more friendly with C# but it's again the nature of the beast of cpp, but to nitpick this is a compiler area moreso than a tooling issue . CPP will compile direct to binary, whereas C# will compile to machine Lang iirc, an intermediary step anyway, so you can imagine it makes debugging much easier.

[deleted]

Re: .NET 10

#518

Earlier quoted context omitted.

And .NET is the language of choice for "Enterprise". So that's what the majority of jobs are. Where as large 'tech' companies don't tend to be like this.

> And .NET is the language of choice for "Enterprise". Yes, again, you're criticizing the practices of enterprises not dotnet. It has nothing to do with how "dotnet shops operate". I'm at a dotnet shop who doesn't work anything like that. I've been at multiple of them. It has nothing to do with dotnet itself.

When a lot of dotnet shops operate this way the difference is negligible.

I'm not saying all dotnet places are like this, but they are common.

Re: .NET 10

#519

Earlier quoted context omitted.

How so? It striked me that the .Net library and Java frameworks like Spring or Quarkus are virtually identical.

There's more to developer experience than that. Your comment even demonstrates one of the differences: The .NET library compared to a bunch of different Java frameworks.

That is indeed a technical difference. But I don’t see much significance in it.

Spring is a de-facto extension of the core java libraries and alternatives like Quarkus follow the same mental model with a better technological foundation.

Re: .NET 10

#520

Earlier quoted context omitted.

The problem is thats how a lot of .net shop operate. I say this as .net developer. .NET gets selected because a lot of non tech companies need to do software things, and they pick the stack fits in with their current WinTel stack. The main concerns is having replaceable talent to reliably do x. They're not trying to innovate. They are often doing something like sending out insurance quotes by email. They do this by h…

What's skills? Pumping out code ala startup? Sounds like a stable environment. Someone with a good eye will still be able to pick out flaws in the processes/architecture and learn a thing or two. "The main concern is having replaceable talent to reliably do X" as in every other company? I swear you guys make having a regular job sound like being under slavery. It's just a job. Some companies are boring, that's just p…

Lots of places are not like this. I work at a large tech company, at its not like this at all.

My machine is not locked down. I can use vim or whatever ide/editor I want. We don't use scrum/safe, we're expected to contribute to the actual system design. etc If I have a choice, i'm not working at a place like that.

However if you work in dotnet at a traditional "enterprise", it is highly likely to be like this. I have a choice, so i'm not going to choose that.

Wanting replaceable talent drives the tech decisions to only use the "standard" microsoft stack. Other companies value picking the right tool, then teaching people. The best companies don't even care what language you use, and are happy to bring you up speed.

I've found a position that uses dotnet which does not have this culture which is good. But i can totally imagine not picking dotnet to avoid this culture.

Post reply on HN