Hacker News new | ask | show | jobs
by benbristow 1596 days ago
ASP.NET is great but it definitely comes under the same banner of 'too many choices needed' compared to Rails.

e.g.

Framework - Which .NET framework do you use (Core/LTS)? Do you use MVC, Razor Pages, Web API and Blazor (Server or WebAssembly) or Web API and an alternative JavaScript/TypeScript based frmaework?. Do you use JSON/XML/SOAP or gRPC? How do you serialize your JSON (NewtonSoft.JSON or System.Text.JSON)?

Database - Do you use Dapper, Entity Framework or just utilize a SQLConnection object manually (And then do you use System.Data.SqlClient or Microsoft.Data.SqlClient)? Which database driver do you you use?

Authentication - Do you implement this manually? Do you use something like Identity Framework? Do you use a third party provider like Azure AD(B2C), Auth0 etc. etc.? Do you use header based authentication, JWT's etc. etc?

Jobs - Do you create a separate service project or Windows Service? Do you use HangFire or Quartz?

Email delivery - How do you render your templates? Do you send via SMTP manually or do you use a third party API like Mailgun/Sendgrid etc. etc.

Folder structure - completely up to you, no real standards there.

Testing - Do you use XUnit, NUnit, MSTest, SpecFlow?

2 comments

> Which .NET framework do you use (Core/LTS)?

There is no "Core" anymore: LTS is now .NET 6. If you are building webpages, the "Legacy" .NET Framework 4.x is no longer relevant in any way (unless you are unlucky enough to have legacy apps with no drive/budget for cleaning up tech debt, and I'm sorry on your behalf). The last LTS "Core" version (.NET Core 3.1) is out of support in December and the upgrade path is simply .NET 6. There's only one choice right now and it is .NET 6. (It'll complicate a bit with .NET 7 in a few months, but only in the alternating LTS/"current" versions way of things like NodeJS, nothing like the Core/Framework confusion of the past few years.)

> MVC, Razor Pages, Web API and Blazor

MVC and Web API merged many moons ago, it's not really a choice between them, they use the same APIs and are built the same way way today.

(Editorializing: Razor Pages is making many of the same mistakes of ASP Classic or PHP/ColdFusion over again, and I don't see it as a great choice personally. Blazor is making similar mistakes to both Razor Pages and Silverlight, and really feels like ASP Classic 2.0. I understand its appeal to some development teams, but wow does it seem like a clunker from my vantage point.)

This comment is ridiculous. You've shifted this from "too many options for everything" to "any options at all". Also, how are these things framework specific? The API vs templates argument also applies for Rails. Choosing an authentication method also applies to Rails. Choosing rendered emails via SMTP vs Sendgrid - also applies to Rails. And so on. You can't mix business requirements with "tooling choices".
Rails has a templating system for generating emails (standard HTML/ERB files). If you're running an ASP.NET Web API (not MVC) the best way of doing that I've found is via RazorLight which you have to set up manually - https://github.com/toddams/RazorLight

For authentication, with Rails the standard is pretty much Devise or Omniauth (or both) - does everything for you. I've never found anything for ASP like Devise which gives you an entire registration/login system with all the required views/models/migrations in a couple commands.

> I've never found anything for ASP like Devise which gives you an entire registration/login system with all the required views/models/migrations in a couple commands.

??????????????????????????????????????????? You know that this is built-in, right?

https://docs.microsoft.com/aspnet/core/security/authenticati... https://docs.microsoft.com/aspnet/core/security/authenticati...

also the same choices apply to rails.

I mentioned Identity in my first comment. I've never found it as simple as Devise though - especially in an API only setting.

With Devise there's a third-party Gem you can use called devise_token_auth which deals with everything automatically.

https://github.com/lynndylanhurley/devise_token_auth