Hacker News new | ask | show | jobs
by pron 1286 days ago
> As a C# advocate I have to say, that the C# design team is doing an excellent job. The amount of syntax I see literally 1:1 taken over by dozen other languages is really impressive and evidence for that.

That would be the case for pretty much any language that has lots of features (provided that most of those features aren't completely terrible). A good design (at least for a mainstream language) also strives to minimise the number of features, not adding everything you can but only adding things you absolutely need. In the case of C#, many of its features are not widely adopted, and Java in particular will never adopt them.

Java's philosophy has always been to wrap an innovative runtime in a conservative language that only adds features late, after they've proven their worth elsewhere and when most mainstream programmers are ready for them, with the realisation that every added feature adds a cost to learning the language. That strategy has worked very well for Java, but .NET has a different strategy (a more adventurous language built on top of a less adventurous runtime). We'd rather spend two years thinking about how to avoid adding a new language feature than spend six months adding it. This "last-mover" strategy has helped us maintain our philosophy and keep the number of features small compared to C#. We strive to only add features that have a big bang-for-the buck and that, preferably, solve many problems at once, rather than add many features, each addressing a relatively small problem. For example, virtual threads have allowed us to avoid adopting async/await; records are allowing us to avoid adopting properties, and will likely help us avoid adding named and default parameters as a separate feature (which, in languages like C#, Swift, and Kotlin breaks binary compatibility/separate compilation).

2 comments

I posted that in parallel. C# tries to be both, a system and application language. Java does not try that. Therefore, they can skip all the memory related topics quite quickly. And that wades out like 80% of the average joe unused features.
> and will likely help us avoid adding named and default parameters as a separate feature

Very cool. Is there any material available about this for further reading?

Not really, except for speculation on my part on how we might end up doing it: https://old.reddit.com/r/java/comments/siv00z/named_and_opti...