News for hackers. Stuff that matters.
Re:.NET 8 by Someone1234 on Tuesday November 14, 2023 @11:44AM (#38265747)
I love .Net, but context is key.

I may suggest .Net for new WebAPI development (minimalist or otherwise), typically with a deployment target of containers and or Linux. It is a strong web back-end language in a similar way to Java but with Linq support, async/await, and a better primary programming language (C#). It has strong integrations into corporate software and all popular DBMS. But, frankly, Linq is the magic that makes .Net special.

Otherwise, for new development, I'd pick something else for creating user interfaces. Like Electron on the desktop and a popular TypeScript based JavaScript framework De jure on the web (utilizing WebAPI in .Net behind the scenes).

Re:.NET 8 by wccrawford on Tuesday November 14, 2023 @12:17PM (#38266248)
Any tips or tutorials for a PHP dev who wants to pick .NET up after a couple decades of not using it? I looked at the project templates in Visual Studio 2022 just for web apps and the options made my head spin.

My wife has worked QA for a number of .NET teams and it just seems like something I should at least keep my thumb on, but I've had nothing but frustration with it so far, even just trying to figure out what template to start with.

Re:.NET 8 by artimaeis on Tuesday November 14, 2023 @12:40PM (#38266631)
I'm not super familiar with PHP -- if you're looking for more of a backend focused project I'd recommend the "ASP.NET Core Web API" template. If you're looking for something that serves HTML pages, possibly the "ASP.NET Core Web App (Model-View-Controller)" template would be pretty straightforward.

There's a pretty good starter tutorial for the Web API one here: https://learn.microsoft.com/en-us/aspnet/core/tutorials/firs...

Or here for the Web App MVC one: https://learn.microsoft.com/en-us/aspnet/core/tutorials/firs...

Re:.NET 8 by wccrawford on Thursday November 16, 2023 @11:45AM (#38291822)
Thanks! I'll take a look at those.
Re:.NET 8 by jcpst on Tuesday November 14, 2023 @01:15PM (#38267179)
PeachPie may be worth a look. It’s a php to .net compiler.

https://www.peachpie.io/

Re:.NET 8 by donatj on Tuesday November 14, 2023 @07:29PM (#38271804)
Oh dang is that really still around? I remember playing with it like 15 years ago. It's been about as long since I've done .Net
Re:.NET 8 by wccrawford on Thursday November 16, 2023 @11:45AM (#38291809)
Haha, cute. I'm fine coding in C#, I just haven't done any web projects in forever. Thanks, though!
Re:.NET 8 by mdasen on Tuesday November 14, 2023 @03:34PM (#38269329)
I'd just create a Blazor project with individual authentication (and don't worry about interactivity). Then inside Components/Pages you'll find code that should look pretty boring. You'll see some HTML, you'll see things like `@page "/counter"` and `@currentCount` and it isn't that hard to understand that the at-symbol means "code thingy" and "oh, @page must be how I specify the URL", and at the bottom there will be an `@code` block. If you look at the authentication pages, you'll see how they handle forms and save things to the database.

There's always more than a comment can talk about, but that's the gist. One good thing is that Visual Studio should be able to help you with a lot of stuff. It's pretty good at keeping you on a good path in the code and pointing out how to fix things.

Re:.NET 8 by wccrawford on Thursday November 16, 2023 @11:47AM (#38291852)
I think I'll eventually look into Blazor, but it seems really cutting-edge and I'm looking for more basic stuff right now, I think. I'm fine with a vanilla html/js front end (or React, or whatever) and having .net do the server side of things.
Re:.NET 8 by oaiey on Tuesday November 14, 2023 @11:51AM (#38265864)
Have a look at Blazor Hybrid. This is really nice thing. Blazor is the first UI toolkit I actually love for many years.
Re:.NET 8 by Someone1234 on Tuesday November 14, 2023 @12:03PM (#38266058)
I have. Too much "magic," and I'm too experienced to fall for that again. No more magic, I should be able to see and understand how every part of my stack works top to bottom.

That's why I'm for isolating the front end from back end frameworks via something agnostic like WebAPI.

Re:.NET 8 by codeTired on Tuesday November 14, 2023 @12:38PM (#38266595)
With blazor wasm you generally do have separate project for front end and api.
Re:.NET 8 by oaiey on Tuesday November 14, 2023 @02:03PM (#38267898)
I am talking about that. Not the server side or server to wasm one.

Maybe I use the term hybrid wrong, I am talking about the fat client hosting blazor/web view one. Basically electron shell just without js