Live data from Hacker News

Understanding the .NET ecosystem: The evolution of .NET into .NET 7

andrewlock.net

231–240 of 357 posts

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#231
post #112

Earlier quoted context omitted.

Jetbrains Rider is great for .NET too, although I didn't try backend developement with it.

It’s awesome. What I enjoy most is, that all the different tools feel the same, and you can use the same kind of IDE also for web developmen, JavaScript and SQL. Rider also has webstorm and datagrip bundled as a plug in, so you can also do everything in one IDE. I prefer though to use the standalone tools for that, they have just less features than rider/IntelliJ, but i would consider that a plus. Less menu items, le…

The Datagrip integration is so cool whenever I need to write raw SQL queries inside Rider

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#232
post #12

Been using .NET for years now for backend web development after having taken a break from C#. It is such an improvement over the old .NET framework. When I started building my first backend with it, I was surprised how much was included and "just worked". Need to add authentication? Few lines. OAuth? Also built in. Response caching? Yes. ORM? EF Core is pretty good. Need to use env variables to override your JSON con…

I have been having a ridiculous time trying to find out just how to override an appsettings json variable (DBConnection string) with an environment variable. Could not find any good answer. What is the right way?

I think it's just:

builder.Configuration.AddEnvironmentVariables();

Then you can use an env variable like "Foo__Bar=X" to override Foo.Bar from your appsettings json.

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#233
post #72

Odd question maybe, my company uses C# and I've been picking up more backend responsibilities. However, I'm a Linux and Neovim user. I do have Windows and Visual Studio available but I just find it awkward. Is anyone here having success with Linux and Neovim for C#? Even trying to learn more about the language is awkward as so many resources go straight into VS.

Rider is pretty much the only decent option for me, if Linux is a requirement. However not even Rider supports .NET Hot Reloading (Edit and Continue), because Microsoft hasn't implemented runtime support for it in Linux. Doing so would probably work against their vested interest in rolling in Visual Studio subscriptions. Yet EnC is a significant timesaver for my projects, to the point where I find it hard to work wit…

> So the most efficient C# development solution for me is going back to Windows and Visual Studio. As they want it to be.

Hot reload works mostly fine in Rider on Windows.

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#234

Earlier quoted context omitted.

… how often are you hand-parsing HTTP requests and hand-crafting HTTP responses one character at a time? Productive devs want the request/response wrapper objects and routing constructs to handler methods to get work done and can still drop down into fine-grained request/response crafting as and when required.

> how often are you hand-parsing HTTP requests That's exactly what I don't do, and what I want to see available in a standard library. But I quite frequently implement custom request handling before any routing happens (if there's even any routing). That's super easy to do in Go, Python or Rust, but when I needed something comparable in C# I haven't found any similar composable independent pieces that I can join toge…

You just add middleware before you register any controllers (or, leave out all that stuff entirely)

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#235

.NET has been doing a lot of things right. My startup's codebase is nearly all .NET 7: landing page, web app, Windows service, API. The main non-.NET code is vanilla JS in the web app. I've been keeping a close eye on Next.js, which is very well done, but I love how versatile .NET is. With one language, I can write all of the above, and my dependencies are minimal thanks to .NET's rich standard library - a refreshing…

How do the costs of running the .NET 7 codebase compare with running something open? I like .NET a lot, have worked with it a lot in the past. But when I tried my own startup, I picked node instead and don't really regret it. I'm getting back into .NET these days though at a new job again, and .NET 7 will be interesting to dive into. Still not sure I'd want to be that tightly-coupled to Microsoft subscriptions though…

> Still not sure I'd want to be that tightly-coupled to Microsoft subscriptions though.

No need for MSDN subscriptions these days, although they do come with some perks.

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#236

My big problem with .NET is that a lot of line-of-business apps were written using ASP.NET Web Forms, but there is no upgrade path other than “rewrite most of it”. It feels like the pain everyone went through upgrading from Python 2 to Python 3. It also doesn’t help that .NET Framework has its support cycle tied to the OS, and hence is 10+ years. This means that businesses can be lazy and just leave these old apps to…

The writing was on the wall a long, long time ago! These companies had 15 years to do it. And it was fairly easy to get webforms + MVC running side-by-side on the same site so you could gradually migrate. Too late for that now though, you can't run webforms + MVC Core side-by-side. You could put a load balancer in front of the old app and start moving end points to a new code base. It's akin to moaning that MS haven'…

> you can't run webforms + MVC Core side-by-side

Besides the obvious IFRAME approach, one could have a single solution with both a ASP.NET Web Application project and another MVC (or Blazor) project. Both of them would reference shared models/services via some .NET Standard 2.0 project. IIS can host ASP.NET Core.

Then start refactoring and rewrite the old HTML4/CSS2 into HTML5/CSS4, while the Server Controls and Master Pages become Razor Components.

There is definitely an upgrade path.

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#237
post #132

Earlier quoted context omitted.

EF handles migration and you can re-use the DbConnection and execute plain SQL. If you don't want to debug difficult queries, then extend it to use Dapper and use the best of both worlds.

You don’t have to use migrations, it’s an optional feature. It works equally well to just generate entities from an existing database, that is migrated/set-up in any other way (as long as the schema is not crazily complex).

Not my project/not affiliate but Evolve is wonderful for handling db migrations

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#238

Earlier quoted context omitted.

1. .NET "Core" ... I tell myself "C is for Cross platform." This is usually what people seem like they mean now when they talk about ".NET". 2. .NET "Framework" ... I tell myself "F is for Former." This is the older, Windows specific version. 3. .NET "Standard" ... I tell myself "S is for Specification." This is just the spec which defines what Core and Framework must implement.

Except .NET Core doesn’t exist anymore - it is just .NET.

True, but I only recently started learning .NET and I had to come up with a mnemonic to help filter out and through older docs and resources. It gave enough clarity to gain traction.

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#239

Earlier quoted context omitted.

> ORM? EF Core is pretty good. We're moving to .Net, and I was surprised by how poor the built-in DB stuff is. It's like either assembly or Python, but nothing in the middle. That said I've also been impressed about how nice it is to get stuff going. I used C# back in the .Net 1.1 days and yeah massive difference in ergonomics.

I'd kill for anything close to EF for Node. Selecting complex structures from a database in any of the existing JS ORMs is just painful.

I've enjoyed the ORM in adonisjs: https://docs.adonisjs.com/guides/models/relationships#preloa...

Having used it on an actual product and dealing with some of the pain points, it's my go-to since the typescript version (v5) came out.

The ORM uses Knex.js internally, which is very simple to drop into if you just want a query builder. Having Knex be accessible also makes it simple to just write your query in plain sql as well, or as the Lucid ORM has available, just fragments of your query (say the join statement) as raw sql: https://docs.adonisjs.com/reference/database/query-builder#w...

Along with debugging, printing out the sql, and support via the Adonisjs REPL "Ace", it makes for a very nice experience.

Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7

#240
post #14

Earlier quoted context omitted.

It really is like finding enlightenment after having to figure out which third party package is best for every little thing in Node. Visual Studio is a pretty powerful IDE as well.

Jetbrains Rider is great for .NET too, although I didn't try backend developement with it.

I migrated a while ago from VS + ReSharper to Rider. Mainly backend work. It’s been great.
Post reply on HN