4 ms·
The Convenience of .NET
- CharlieDigital 3y agoI know that this article is talking about a lower level of "convenience", but I have to say this about .NET and C#: it's probably the most "convenient" platform and language at the moment. Around 2020, I left a company that was building .NET Framework and barely started transitioning into .NET Core. Then I spent two years working at various startups doing full-stack, primarily TypeScript on Node on the backend. And within the last year, spent a stint at one of the very few SV, VC-backed startups using .NET Core and came away pretty convinced that .NET Core and C# are what most teams want when they want some non-Node platform alternative. 1. C# is syntactically very similar to TypeScript so it's not difficult to pick up. Generics, try-catch, async/await, type inference, Array ops vs LINQ, etc. It means if your team is already doing TS, it's easy to pick up C#. If you're hiring, it's easy to train TS devs for C# 2. It has a nice mix of OOP + functional programming support owing to F#. Pattern matching, lambdas, records, tuples, destructuring, etc. 3. Entity Framework Core is arguably the best, most mature ORM out there. It supports a variety of backing stores and programming styles. 4. The language and platform are foundationally sound and stable. Go just got generics within the last year. Async Rust is still evolving. .NET and C# are 20 years old at this point and very stable. 5. Building .NET micro-apps now is so simple with the out-of-the-box templates. `dotnet new webapi -minimal` and you get an Express-like web API without needing to add any imports or do any additional setup. 6. Whether you want to believe the TechEmpower benchmarks or not, it is decidedly higher throughput than Node which translates to real $ saved on runtime costs at scale. 7. .NET and the large corpus of first-party libraries are maintained by an army of professional engineers at Microsoft that are constantly monitoring and patching it. You reap the benefits. 8. Platform tooling is really good. Builds are fast. Hot reload works reasonably well. Cross platform support for most common use cases is really good; I've been doing all of my .NET work on an M1 Mac for almost 2 years now and deploying into AWS and GCP on x64 and Arm64 targets. I've interviewed with some teams that ended up investigating Go and Rust once TypeScript and Node became cumbersome -- always end up skipping .NET and C# for some reason. It's odd because these same teams embraced TypeScript, VS Code, and GitHub but then give C# the side-eye.
- mdhb 3y agoI know this hasn’t been true in reality for some time now but subconsciously I still have it so closely tied to the windows and azure ecosystem for some reason and doesn’t really cross my radar as a result. I say that as someone who actively went on the hunt for a new language around 2020 as well after years in the Ruby community. C# would have been a fine choice in a lot of ways I think. I ended up with Dart which is syntactically very similar and shares many of the same advantages but remains a very small ecosystem. Either way I really enjoy sticking my head into other communities posts like this and just seeing what’s going on with them. I always enjoy the compare and contrast exercise of it all.
- sakesun 3y agoEntity Framework Core restore my faith in ORM approach.
- CharlieDigital 3y agoIt's quite good -- with some footguns to watch for (serialization to JSON, for example).
- bob1029 3y agoMy favorite example of how far this convenience goes is demonstrated by items like the following from System.Numerics: public static System.Numerics.Matrix4x4 CreatePerspectiveFieldOfView ( float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance); https://learn.microsoft.com/en-us/dotnet/api/system.numerics.matrix4x4.createperspectivefieldofview?view=net-7.0 https://learn.microsoft.com/en-us/dotnet/api/system.numerics... I don't know of many other ecosystems that offer methods that allow for construction of FPS-friendly projection matrices in one first-party function call. If you peruse the docs you may find related methods that a game developer would find quite useful. You may also find that everything that can be SIMD-accelerated already has been. So, it's not just that .NET is convenient. Many of these conveniences are also approximately the fastest & safest way to do things since so much attention has been placed behind them. All of Microsoft's customers is a hell of a QA team. There is absolutely a herd mentality to this, and it works. Microsoft.* and System.* covers 99.99% of use cases if you simply allow them to. For me, this is the central competitive advantage that .NET has over most others. I do a lot of work with banks, and they audit the hell out of 3rd party. Every non-Microsoft nuget I pull down will need to be explained to our customers.