object[] array = new string[10];
// throws a run-time exception
array[0] = 10; object[] array = new string[10];
// throws a run-time exception
array[0] = 10;Other data structures like List<T>, Span<T>, etc. do away with covariance. There's an upcast for ReadOnlySpan<T> but only because it's zero-cost and does not introduce the issues stemming from covariance.
Luckily, you almost never see someone use array covariance beyond occasional object[] upcasts (and the compiler is also good at reasoning whether to insert covariance checks or not).
Thus having high compatibility with how Java used to be was a big factor designing C# 1.00
At the same time, JVM has embraced the polyglot ecosystem CLR was supposed to be, while C# seems to have sucked the life of all those language implementations demoed at the launch back in 2001, and .NET SDK being offered on computer magazine CDs.
Which is kind of interesting, how things have changed 25 years later.
At least we finally have cross platform support (ignoring Mono and DotGNU efforts), and good AOT instead of NGEN, which should have been there on .NET 1.0.
> VSCode Java experience is still ahead of C# DevKit thanks collaboration with Red-Hat, and doesn't require an additional licence.
I'm not sure if you're intentionally attempting to make inflammatory replies or something in what I said rubbed you the wrong way.
(for other readers - this marks me posting for 20th time here that DevKit is an optional product and thousands of developers are happily coding in C# in VS Code and VSCodium, Neovim and Emacs without ever running into it)
I am stating facts, do you want links to .NET team interviews where they assert it is a business decision VSCode is never going to achieve feature parity with VS for .NET?
VSCode for Java doesn't have such artificial constraint, hence the better tooling, mainly implemented by Red-Hat.
C# DevKit being optional doesn't change the fact specific features are only available when users opt into using it, with a corrrespondig Visual Studio license.
And yes, this irritates me, because I feel it is a disservice to .NET community how Linux and macOS developers are kind of 2nd class, not by .NET team themselves, but higher up Microsoft management.
And also, have you tried writing Java in VS Code? I have and it is overall worse (read: less stable) than just using IntelliJ Idea in a way that isn't an issue when doing so in C#/Go/Rust/TS.
Lucky one I guess.
I have used it, its stability issue is orthogonal to feature parity, being whole Eclipse running headless, which is the point, features.
WinRT was supposed to replace .NET by the original goals, after the Sinofsky and his followers took over Windows development after Vista, it has been COM as the main API.
"Turning to the past to power Windows’ future: An in-depth look at WinRT"
https://arstechnica.com/features/2012/10/windows-8-and-winrt...
However as we all know by know, it didn't went down as expected.
Now those blog posts are kind of gone from their original hosts.
F# HOPL paper,
https://fsharp.org/history/hopl-final/hopl-fsharp.pdf
Original blog post on way back machine, including the link to "MSR White Paper: Proposed Extensions to COM+ VOS (Draft)" paper.
https://web.archive.org/web/20190111203733/https://blogs.msd...
There was mostly no reason to cause unnecessary code churn to rename pre-existing code with complus-named variables inside dotnet/runtime. External-facing features and documentation never reference it. For compatibility reasons it still recognizes env. variables prefixed with COMPlus_ alongside DOTNET_ though.
See: https://github.com/search?q=repo%3Adotnet%2Fruntime%20complu...
In a similar vein, NativeAOT code still prominently references project RedHawk (these are slowly being renamed).