7 ms·
Not really - Java designers were just plain wrong and it took forever to admit it - things like local type inference (var) made the language pointlessly verbose
by rubber_duck 6y ago
Not really - Java designers were just plain wrong and it took forever to admit it - things like local type inference (var) made the language pointlessly verbose for ages, and simple features like lambdas made the standard libraries terrible.
There was a 8 year gap where C# users could use stuff like enumerable operators while Java users were stuck in the stone age of writing loops for collection manipulation in a high level language ...
- pjmlp 6y agoJava designers don't follow fashion, they rather wait to see what actually works when the dust settles and how to keep those binary only 25 year old jars running on modern JVMs. I have been working with Java, .NET and C++ since they exist, and C# being more feature rich than Java doesn't help if the libraries or OS support that a customer needs isn't there.
- BoorishBears 6y agoC# doesn't follow fashion either, it does things that actually work before the dust settles on them. I think you'll find many people outside the HN crowd also appreciate their approach over trying to appease the kinds of customer needs that involve keeping 25 year old binary only jars running. To me .NET Core is a shining example of that
- bartwe 6y agoC# has been moving much more quickly since then, async/await comes to mind as a feature that didn't work out
- thelazydogsback 6y agoHow did they not work out??
- pjmlp 6y ago.NET Core has been so good managed, that I a project back in the .NET Core 2.0 days to port an application to Java, because the customer wanted to move the application to UNIX (not just Linux flavours), and not all necessary features could be done in Core. To this day there are plenty of libraries that are yet to run on either Core or outside UNIX. Plus not everyone is happy how the whole Core, .NET 5, .NET Native, Reunion, UWP, CoreRT, Xamarin, MAUI, Blazor is being managed. A language alone isn't enough.
- BoorishBears 6y agoI mean .NET Core is targeting Linux, is that really a sign of mismanagement? And to your second point.. I mean you're comparing concepts at very different levels of a stack. Your list includes a language runtime, a web framework, an OS specific application format/framework? It's like saying "Java, HotspotVM, JavaFX, Tomcat, Android APK, Vert.X"... In reality it's ".NET Core and .NET Framework". And while there have been some growing pains as the term .NET became overloaded, it's always been clear .NET Core is where they want people to be, .NET Framework exists because migration to a new platform wasn't going to happen overnight. Every year there's more and more .NET Core compatibility, they've done a good job with .NET Core so more people are willing to use it (and port packages to it) https://docs.microsoft.com/en-us/dotnet/standard/choosing-core-framework-server https://docs.microsoft.com/en-us/dotnet/standard/choosing-co...
- pjmlp 6y agoNaturally I am comparing all levels of the stack, as I mention on my comment a language alone is useless. Yes, the future is .NET Core, however pretending that outside Windows it can match Java offerings just reveals a complete lack of knowledge of all kinds of platforms that have Java support available for them. Guys like PTC, Aicas, Gemalto, microEJ doing embedded real time Java, selling M2M devices, IBM and Unisys mainframes, 80% of the mobile world (even if it is an adulterated flavour of coffee), smartcards, blue ray players, healthcare and TV settop boxes, kiosks and plenty of other use cases. .NET is catching up with 25 years of Java doing cross platform development, while anything that came out of Redmond has been mostly Windows only for 20 years. .NET Core only supports the three major mainstream OSes, zero support for anything else, and has the growing pains of a platform where plenty of third parties are yet to release anything on Core. Sitecore just released their first version on .NET Core earlier this month, and I don't see anyone rushing to upgrade. Doing WPF, Forms? Good luck with many GUI component libraries. Apparently the designers are going to miss .NET 5 for full stability. The beautiful thing with being a polyglot consultant is that I don't have to convince myself that I am using the best stuff as "Developer X", I just use whatever stack the customer asks for and then move on.
- Const-me 6y ago> over trying to appease the kinds of customer needs that involve keeping 25 year old binary only jars running C# doesn’t break too many things while it evolves. Example: https://docs.microsoft.com/en-us/dotnet/api/system.collections.arraylist?view=netcore-3.1 https://docs.microsoft.com/en-us/dotnet/api/system.collectio... That class was introduced in .NET 1.1 way before generic, still present in the most recent .NET Core 3.1. They sometimes deprecate higher-level stuff, but very conservatively so. E.g. asp.net web forms (2002) is deprecated, while windows forms (also 2002) is still supported.
- pjmlp 6y agoTry to run random .NET Framework Assemblies on .NET Core or .NET Native, this is what Java philosophy tries to avoid. Forms designer is still broken on .NET 5, and it might not make it to the final release.
- fomine3 6y agoThis is a single breaking jump after 20 years. This migration is really needed and well considered.
- greggman3 6y agoI've never had anything but problems trying to run Java apps. Maybe in server land it's been great but in desktop land, outside of Minecraft, it's always been hell for me.
- ThrowawayR2 6y ago> "Java designers don't follow fashion, they rather wait to see what actually works when the dust settles and how to keep those binary only 25 year old jars running on modern JVMs." Yup, for better or for worse, Java will be the COBOL of the 21st century.
- pjmlp 6y agoApparently 21st century developers don't have much issues dealing with UNIX and C, just about 10 years younger than COBOL, speaking of which, both about 30 years older than Java.
- ThrowawayR2 6y agoOne can be staid and stale at any age. Aside from that, the average 21st century developer would have a meltdown trying to use C.
- chrisseaton 6y agoIt's a feature, not a bug. Java is stable, and evolves with a huge amount of thought (they employ theorists to model the impact of changes to the Java language even.) The benefit of this is a long-term platform, and an excellent implementation. Due to this Java has become the platform where the majority VM research is done, which means Java has many excellent state-of-the-art garbage collectors and a JIT a level beyond that of C#.
- logicchains 6y ago>which means Java has many excellent state-of-the-art garbage collectors and a JIT a level beyond that of C#. Unfortunately this isn't enough to make up for the latency hit from not being able to directly stack allocate things like C# allows (especially with its recent addition of Span<T>).
- chrisseaton 6y ago> make up for the latency hit from not being able to directly stack allocate things Java does better than direct stack allocation - it does automatic scalar replacement instead.
- logicchains 6y agoCan automatic scalar replacement turn my ArrayList<Pair<Long, Double>> into the equivalent of std::array<std::pair<int64_t, double>, N> (or Span<Tuple<long, double>>)?
- chrisseaton 6y agoIt doesn't turn it into the equivalent of another data structure, and it doesn't allocate it on the stack, that's why it's better. It turns each value in the collection into a dataflow edge which then goes into a register, or the stack, or anywhere.
- inamiyar 6y ago
- codebolt 6y agoEven then they fumbled the execution. Why on earth would they make streams without support for native types?
- pjmlp 6y agoLike this one? https://docs.oracle.com/javase/8/docs/api/java/util/stream/IntStream.html https://docs.oracle.com/javase/8/docs/api/java/util/stream/I...
- codebolt 6y agoYes, but that seems like a clunky add-on. Something as basic as iterating the characters in a string should not require special constructs like this IMO.
- chrisseaton 6y agoHow would you have implemented it, while satisfying their constraints of extreme backward-compatibility?
- Hokusai 6y ago> local type inference (var) made the language pointlessly verbose for ages I guess that this is a question of taste. What for you is "less verbose" for me is more confusing to read. I like to see the types as they complement variable naming. To avoid typing a few letters the code will for ever require me to double check the types with help of the IDE. I have worked in medium sized corporate companies. The code base is quite big and one of the 20+ development teams may get transferred a project from another team (does not happens super-often, but it happens) or they may create pull-requests for bug fixes (this is more common). Clear and easy to understand code is life saving. In one of the companies I worked for a Javascript team send a -1 instead of a "-1" the cost ramped up the hundreds of thousands of dollars and our clients were not happy about it. Rollback mechanisms were used as fast as our clients detected revenue problems on their own customers. And the tests did not got the error as the values is used at the integration layer between our clients and us. I see safety an increasing value as our programs control more and more money and more and more services. And, I have to admit, I feel more comfortable with more verbose code.
- wutwutwutwut 6y agoDid you spend any significant time working with C#?
- Hokusai 6y ago> Did you spend any significant time working with C#? I have no experience with it at the corporate level. There, I have seen, it mixes a lot with .NET. So, I guess that the corporate equivalent to Java is "C#/.NET". I spend some time several years ago with C# in Unity3D, thou. I really liked the C# language. I found the Auto-Implemented Properties a neat compromise between encapsulation and verbosity (Verbosity has no value if does not add information). Java is trying to be everything to everyone and that is a mistake. I liked Java more in the past, and I would have added just a few things from the past iterations of the language (e.g. Modules is a good idea that actually simplifies the language and moves much code to "frameworks" instead of being part of the core language). C# seemed more focused on its initial style were Java is stretching all over the place.