Hacker News new | ask | show | jobs
by ivraatiems 1483 days ago
I'm a full-time C#/.NET developer, and have been for about five years. Here are a few observations:

1) As time goes on, C# is increasingly just F# with different syntax. LINQ, closures, records/immutable structures, and so on - you can write code in C# that is more functional than it is object oriented these days. This is mostly a good thing; it also means that (to my eyes) the language has become much more elegant over time.

2) The level of cross-platform compatibility you can get if you're using .NET Core or .NET 5/6 is pretty fantastic. Performance has also improved dramatically. C# is in no way limited to Windows as an environment anymore - unless you have a dependency on .NET Framework.

3) Everybody has dependencies on .NET Framework. Those who don't have dependencies on unmanaged Windows DLLs.

4) Great debugging/developer tools, as others have mentioned. VS and Rider are both top-of-the-line IDEs.

5) C# is not and will never be cool, sexy, or the thing of the moment. It is a language for getting things done in an easy-to-comprehend way and that's just about all it is. I like it very much.

1 comments

How realistic or common is it to mix C# and F# in one code base? As an example, even though Java and Scala run on the same JVM their ecosystems have mostly diverged. In contrast to the Scala situation F# has been officially supported by MSFT for years so it's probably different on the .NET.
The compiler won't build a project using multiple languages, it doesn't understand. For a long time, VB code and C# code were 100% interchangeable, and they of course, both compile down to IL. (Identical IL code, in theory, if literally the same code reflected in different languages.) In theory, you would imagine that you could include .cs and .vb files in a single project, and the compiler could link them, but alas, it is not possible.

There's no issues using a library written in one .NET language from another .NET language though, so if you can break the project up a bit more, you can work in multiple .NET languages.

The way to get around this is just to have multiple projects - at my employer, we regularly have projects written in C# and F# in the same solution, and depending on one another. That will work just fine.
You can also build a module instead of assembly (=default output of a project) but IDE support for modules is limited. After the modules are generated, an single assembly can be made from them.