Live data from Hacker News

.NET 10

devblogs.microsoft.com

581–590 of 605 posts

Re: .NET 10

#581

Something great about this release as well is the release of "file-based apps" https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals... Basically, you can now write scripts in C# without the ceremony of a solution or project file — writing some code in a cs file and running `dotnet run myFile.cs`will execute the file directly. You can also shebang to make it directly executable! Hoping this inspires more peopl…

That's how I learned C in the 80s. Just compile the C file into an EXE. It's a good way to get started.

That said, I'm certain you've always been able to simple compile a .cs to an .exe? When I ran guerilla C# programming classes in jail, I couldn't get anything from the outside, so I was stuck with the .Net v2 csc.exe which is squirreled away in a subfolder of Windows on a default install of Visa.

What .Net 10 adds though is the ability to even scrap main() and just write code like it was Basic.

Re: .NET 10

#582
post #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.

That workaround seems wild as hell.

Re: .NET 10

#583

Earlier quoted context omitted.

>If i remember right Java's webserver beats ASP.NET in performance benchmarks That's not the case anymore. Kestrel is one of the fastest servers there is, and it beats every Java server out there.

I do not have any benchmarks other than this[1] to refer to, but I work with Quarkus[2] and Java 25 LTS (just recently released) services deployed on AWS EKS and we are very happy with the performance (for mobile game backends) [1]: https://sharkbench.dev/web [2]: https://quarkus.io/

Quarkus does a lot of bytecode generation magic at build time, which will give it an "unfair" edge in some scenarious, like this simple serialization/deserialization case in this particular benchmark.

Re: .NET 10

#584
post #573

Earlier quoted context omitted.

>Everywhere you look there are tons of half baked projects like Blazor We used Blazor years ago and it worked flawlessly already then. Hard to believe it's worse today. And what's wrong with Identity? >progress in .NET is super slow Compared to what?

Blazor will produce super bloated web apps. I can see it being used for an in-house thing with captive users but for a real world product or a public app? It would be a terrible choice. Also the DX is just not there. Hot reload is a mess. Even when it works it's too slow. Once you start using hot reload with Vite you can't go back to waiting seconds for every change and full page reloads. > Compared to what? Everythi…

>Do you think it's acceptable that it took 4 years for Minimal APIs to get validation?

Well thay don't call it Minimal API for nothing. Jokes aside, what stopped you from calling validation yourself explicitly?

>What about hot reload being broken for years and years?

Can't comment on this, because I have never needed it. I can work faster with writing tests, but I guess it's fair to assume there are some who would need it.

Re: .NET 10

#585

Earlier quoted context omitted.

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 d…

That’s a good argument. I had not considered properties in those terms before, and have historically been skeptical of them in many languages. I’m partly convinced now! I still worry a bit about property authors who don’t follow the “cheap, non-side-effectful, externally cacheable” rules, though. Perhaps there are linters in property-ful languages which would help with that.

> I still worry a bit about property authors who don’t follow the “cheap, non-side-effectful, externally cacheable” rules, though. Perhaps there are linters in property-ful languages which would help with that.

Definitely a problem when a developer goes rogue and breaks this rule. I'm not sure if there are linters that helper with this. I don't think either VS, Rider, or the .NET Compiler include any analyzers that complain about this. If they do, I haven't seen the warnings before. I generally tend to enforce this during code reviews with my team.

Re: .NET 10

#586

Earlier quoted context omitted.

I've tried that and got heavy push back from other developers funnily enough.

Why? How does it affect them if you decide to use your allowance to donate?

Not affect them personally but more around what value is the business getting. We agreed to disagree :(

Re: .NET 10

#587

Earlier quoted context omitted.

> Need a database - should it be SQL Server? "I am using Java. Need a database - should it be Oracle?" .NET Core 1.0 was released almost a _decade_ ago.

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

> Java was originally Sun Microsystems.

I am well aware.

Anyway, for the sake of the argument: "I am using Java. Need a server machine - should it be SPARC?". It makes nearly as much sense.

Re: .NET 10

#588
post #476

Earlier quoted context omitted.

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

> I can't see myself ever adopting it for any real work Why not? I see a lot of people saying they don't like it or won't use it but few of them list any reasons to, the ones that do raise issues from 20 years ago that have since been resolved. Maybe you should give it a try, you'd be surprised how productive the language is and how comparatively unproductive all other languages and ecosystems are.

I have tried it recently. It felt like I was coding Java. I realize "feel" isn't very objective, but I don't really like C-like languages in general. I like Rust, but only because of it's heavier FP-influence. C# is one of those languages where you don't mean to, but you can't help just creating tons of files/boilerplate/etc., which feels just like Java. Just my perspective, others obviously feel differently.

Re: .NET 10

#589
post #154

Earlier quoted context omitted.

> Apropos, what do they do for fun? Odd question, but as a .NET developer myself Mountaineering, climbing, bouldering, going to gigs, playing pool, running, music festivals, gaming, photography, watching F1, watching NBA, eating out with friends... I'm not sure what the point of the question was ?

Ah, well, obviously the point of the question was to be odd for oddness's sake, as some form of bizarre, self-inflatory social ploy! I couldn't possibly have intended my question as a straightforward request for information about something, now could I? That would just be weirdy-weird, if people started asking each other questions for the purpose of receiving answers. Thanks for answering though.

The reason I thought it was odd was that I've never seen any correlation between someones hobbies outside of work and what tech stack they use at work.

Re: .NET 10

#590
post #527

Earlier quoted context omitted.

You know there are people.. programmers.. who are not C# developers... and likely refuse C# because of various reasons.. right? It can be based on the fact its Microsoft. My comment is based on startups and, from my experience, people like go all in on C# because decisions have been made to go all-in Microsoft. C# has come a long way in the last 10 years. This much is clear, providing better support outside of the Wi…

> There was no C# in 1995 Delphi was the hit story then.

Correct.

I was using it in my college projects back in 2001.

Post reply on HN