3 ms·
> How .net got so many things right where java did not is a mystery to me Part of the reason for that is that Java is older. https://en.wikipedia.org/wiki/C_Sh
by Someone 4mo ago
> How .net got so many things right where java did not is a mystery to me
Part of the reason for that is that Java is older. https://en.wikipedia.org/wiki/C_Sharp_(programming_language)#History https://en.wikipedia.org/wiki/C_Sharp_(programming_language)...:
“In interviews and technical papers, he has stated that flaws in most major programming languages (e.g. C++, Java, Delphi, and Smalltalk) drove the fundamentals of the Common Language Runtime (CLR), which, in turn, drove the design of the C# language.”
Also, some of Java’s design warts may be there because Java was initially envisioned for much smaller devices.
- toyg 4mo agoThis. C# was basically always meant to be "Java but done right". It came several years later, after Microsoft was legally barred from "EEE"-ing Java and required a direct competitor.
- cm2187 4mo agoBut what I don’t get reading the original article is that they present how to insert struct in an object oriented language as an intractable problem, whereas a good implementation with .net (as far as I can tell) has been out there for nearly 30 years. And C# was shameless about stealing from other languages.
- pjmlp 4mo agoThe problem is how to do it without breaking ABI, 30 years of Maven Central is very relevant, Java isn't doing a Python over value types.
- cm2187 4mo agoBut if you define a new type, how is that breaking backward compatibility?
- pjmlp 4mo agoBecause that is missing the point. All the types that are value types in semantics, e.g. Optional, should be proper value types on Valhalla. Additionally, they should be compatible with existing code that expects them as parameters, fields,.... without being recompiled from source. If it is a complete new type without backwards compatibility, no one is going to adopt it, other than a few niche cases.
- gf000 4mo agoWell, my old code can have a List<Object>, and I can pass my new type into it and have it do some operations. Let alone with reflection - so backwards compatibility is more complex than that. As for structs, Java avoids e.g. tearing issues with making them immutable, while it is easy to optimize it to local modification under the hood.
- Someone 4mo ago> how to insert struct in an object oriented language as an intractable problem, whereas a good implementation with .net (as far as I can tell) has been out there for nearly 30 years. And C# was shameless about stealing from other languages. I think (but may be wrong) their concerns are about the insert part. C# always had structs, Java wants to add them in a backward-compatible way. They want, for example, existing generic container classes pulled in from a .jar (i.e. already compiled) to support Java value types.
- Zardoz84 4mo agoDlang this this before. You have classes and struts, with different semantics.
- pjmlp 4mo agoUnfortunately D will remain a niche language due to various reasons, and is D not Dlang.
- pjmlp 4mo agoIronically, they still do need Java for Azure, https://devblogs.microsoft.com/java https://devblogs.microsoft.com/java
- newsoftheday 4mo ago> It came several years later, after Microsoft was legally barred That is an eloquent way of re-writing the history of Microsoft stealing Java and not being allowed to get away with it.
- toyg 4mo agoThey didn't "steal" anything, iirc; they started as a legitimate licensee and then tried their usual embrace/extend/extinguish as "J++" (the EEE I mentioned). Sun sued for breach of license and won, barring Microsoft from extending Java outside of the (Sun-controlled) process. So they dropped it and built their own version, with blackjack and hookers.
- dingi 4mo ago> So they dropped it and built their own version, with blackjack and hookers. This cracked me up