As a fan of O'Caml, I have to ask: what's the status of F# on .NET? ...and is it used much compared to C#, or is its use at least growing, or is it stagnating/dying?
Understanding the .NET ecosystem: The evolution of .NET into .NET 7
201–210 of 357 posts
Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#202Earlier quoted context omitted.
Technologies don’t live forever. At some point you need to upgrade, and at some points there will be some major breaking changes. .NET 4.8 is still fully supported, and there is no end-of-life communicated yet. It is a part of windows server 2022, which will be supported until 2031, that’s probably the earliest possible end-of-life date for .NET 4.8.
If people are looking at what technologies and companies to invest in, knowing that they may be left high and dry with a "full rewrite"-level of breaking changes is a valid and relevant critique. You want to know you'll be supported through difficult transitions, and that isn't unreasonable. I don't understand why people are coming out of the woodwork to tell everyone that full rewrites are a perfectly normal and exp…
Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#203Earlier quoted context omitted.
There are other libraries than Moq. Nsubstitute, FakeItEasy, etc. With Moq and most mocking libraries, you generally just need to make a method virtual for mocking concrete classes. Most mocking libraries use Castle Project's Dynamic Proxy, so they should be able to inject things without the need of interfaces. Interfaces for everything comes from the .net community's obsession with patterns, abstraction, clean archi…
Right, marking methods as virtual is the other route I saw. Are most C# codebases opting to do that rather than add interfaces? It feels weird to edit signatures like that for testability, but maybe it's just what I'm used to - I'm putting all of my objects in constructors already for testability's sake, and I'm no stranger to making a factory or two. VSCode has been my way forward for file-based editing so far. It's…
I personally use stubs for higher reuse, favor integration/functional tests over units, and InternalsVisibleToAttribute to allow the use of internal classes / methods from test assemblies. Its been a long while since I reached for a mocking library. I probably use structs, statics, and extension methods more than the typical dotnet dev. And for DI, I have no qualms just using concrete classes or base classes.
I also built my own extensions to xunit to enable DI in test methods, since I do more integration tests.
Extension methods for interfaces can be very powerful along with the newer default interface feature. So using that where it makes sense, I get.
In dotnet itself, interfaces are only heavily used for key extension points, so you see them more enforcing specific idioms like IComparable, IReadOnlyList or adapter/extensions for System.Data.x, Microsoft.Extensions.x, and Asp.net core MVC. For the adapter types of things there is generally a base class that implements key interfaces and you can create stubs or mocks from those.
For the files... for stuff in the root folder like .editorconfig, gitignore, etc. I generally create a virtual Solution folder and add those files to it.
For folders with larger amounts of files, I sometimes create an empty project or use specialized project for it like node or powershell project which can be installed as VS extensions, especially if its for a project where the team lives in Visual Studio.
That said, I do most of my coding in JetBrains rider or vscode these days and keep a terminal open. When I'm on a windows box, I have nano and neovim installed, so I can just quickly edit scripts that way or just do code /path/to/file as needed.
Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#204Been 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…
nestjs provides a comparable experience for nodejs as well
Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#205Earlier 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.
Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#206Earlier quoted context omitted.
Northern Europe runs on C# and .Net. I am not joking. There are more C# jobs in Denmark than Python, Node.js, Ruby, and PHP jobs combined.
It is surprising to me that C# and .NET is comparatively under-represented in North America where it was born. Nothing but good experience in developing and operating software with it, both desktop apps (Win/Mac) and backend services (Linux).
Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#207Earlier quoted context omitted.
So the bottom line is that .NET Core can't call a .NET Framework library. It must be converted to .NET Standard first. And despite deprecation (let's call it that), .NET 5, 6, 7, 8 will continue to support calling into .NET Standard libraries.
I am not sure this is (still) correct - I am able to call into a .NET framework 4.8 library from .NET 7.
Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#208I spent a lot of time as a Java developer and have recently moved into a spot where I'm being asked to work with C#. A few things rub me the wrong way, and I'm wondering if it's just ignorance and / or me being stuck in my old ways. - Unit testing with mocking is kludgy compared to Java and Kotlin (Moq vs Mockito). There's no mocking of concrete implementations for technical reasons, perhaps unless you shell out mone…
Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#209Been 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?
System.Environment.GetEnvironmentVariable("NAME") ?? ...Re: Understanding the .NET ecosystem: The evolution of .NET into .NET 7
#210Earlier quoted context omitted.
> I was surprised how much was included and "just worked". A simple HTTP server? Maybe I'm missing something, but when I needed it I hadn't found one. I believe, the closest it has is System.Net.HttpListener which is a very different thing from your typical Golang's net/http.Server or python's http.server.HTTPServer. I believe at some point they had switched from HTTP.sys to Kestrel, so at least it doesn't need the a…
… 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.
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 together in a way I see fit.