5 ms·
>The Java strategy of being very conservative about what you add to the frontend would have done C++ a lot of good after C++11 (or even before that). Java lost
by rubber_duck 6y ago
>The Java strategy of being very conservative about what you add to the frontend would have done C++ a lot of good after C++11 (or even before that).
Java lost a lot of mindshare to C# and Kotlin due to that "strategy".
- pansa2 6y agoIt seems to me that for many developers, all they want from a language is more and more features. I’m grateful for languages like Go and Lua that try to buck this trend.
- pjmlp 6y agoYeah, it is so liberating to write boilerplate libraries.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- pjmlp 6y agoJust for the HN crowd. C# still doesn't deliver on all platforms where there is a JVM available, and has yet to even offer something as portable as Swing across all those platforms. Kotlin really only matters on Android. In fact right now we are having issues with .NET RFPs, because everything that comes through the door are Java related RFPs.
- rubber_duck 6y agoNot 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??
- codebolt 6y agoSwing is a horror show from both a developer and an end-user perspective, don't know why you would even mention that. Windows desktop apps based on Forms or WPF are in another league both in terms of ease of development and user experience.
- pjmlp 6y agoSwing is only an horror show for those that don't bother to read books like "Filthy Rich Clients", or don't want to spend money on a proper design team. Why do I mention? Because until now .NET Core still doesn't have anything like Swing across all supported platforms. MAUI might do it (Xamarin renamed), or you might just get Blazor running on WebWidgets. I rather have Swing if the alternative is running Blazor that way. Not counting community toolkits here, just what is available out of the box.
- fomine3 6y agoI worked a bit for a project that tries to make Swing Application to touch friendly. There's almost zero support for touchscreen.
- hackingthenews 6y agoBut that is not inherently a bad thing. If we look at programming languages as tools, it makes sense for them to get out of date and new ones taking their place, with all the lessons learned. So its possible that programming languages like C++ that keeps extending their own life through adding features (while keeping weaknesses), will ultimately cost the community/industry more in the long run.
- rubber_duck 6y agoI'm not saying Java should have introduced ground breaking features - I'm saying they made design mistakes that they should have corrected far sooner (var/type inference) and refused to add some basic features (lambdas) that would have made the code a lot better for it. They did add those features eventually (Java 8) - about 8 years behind C# (since C# 3.0)
- Aerroon 6y ago>If we look at programming languages as tools, it makes sense for them to get out of date and new ones taking their place, with all the lessons learned. Part of me thinks that this is how it should be. Extending a language constantly while providing backwards compatibility can lead to some awkward syntax too.
- hackingthenews 6y agoAgreed. Just gonna drop this here: Nicolai Josuttis “The Nightmare of Initialization in C++” [0] [0] https://youtu.be/7DTlWPgX6zs https://youtu.be/7DTlWPgX6zs
- pietroglyph 6y agoThe thing is that this is not a huge issue in practice. I stick to uniform initialization in 99% of cases and it works out pretty well. I have far fewer bugs from initialization screwups than from other things.
- 6y ago
- cletus 6y agoSo C# definitely benefited with the second mover advantage. It learned a bunch of lessons from Java such as: - No checked exceptions - Properties (I wish Java would add this to the core language instead of relying on things like Lombok as it shouldn't change the IR and really is just syntactic sugar) - Partial classes. This really isn't in contrast to Java because Java has nothing like it. But it is a neat feature for partial code generation; - LINQ. Java eventually added streams but last I checked it still had performance issues and IMHO LINQ is just cleaner; - Conditional compilation. This is really a huge oversight. One of the huge benefits of the preprocessor in C/C++ was conditional compilation. It's great than C# included it. It's bizarre to me that Java hasn't. - Async/await. Honestly I still find C#'s version of this more awkward than Hack's. Experience has taught me that whenever you spawn a thread, you've probably made a mistake as subtle mutlithreading bugs are the devil and cooperative multitasking like you have in Go, C# and Hack is usually far safer and sufficient most of the time. Still, C# is still better than Java here. - C#'s reified generics vs Java's type erasure. I think it was the right decision to break backwards compatibility here (and I don't usually say this). This was pretty early too (IIRC generics were added in C# 2.0). But all that being said, I still think Java has a large mindshare and install base than C# by a mile. it's not sexy so it gets less attention on HN but Java is still massive. As for Kotlin? Much like Scala I see this as nothing more than a curiosity. Android developers seem to like it but I think it's a tiny fraction of Java still.
- distances 6y ago> As for Kotlin? Much like Scala I see this as nothing more than a curiosity. Android developers seem to like it but I think it's a tiny fraction of Java still. Java is massive for legacy reasons, but would be nice to have some statistics regarding new projects. The last two companies I've worked for had backend teams using Kotlin so I've been assuming this is also preferred by backend people. Could well be that this has was an anomaly though. I mostly develop for Android so my own perception is obviously biased, as Java is pretty thoroughly erased from this world now.
- pjmlp 6y agoEasy, JVM == UNIX == Browser, Java == C == JavaScript. Anything else on the JVM is nice to have, but isn't where all the goodies are. Google has a special interest in getting rid of Java, hence Kotlin. In fact, it is going to be fun to watch how they will keep up with the pace of the JVM, because when the majority of key libraries move to modern Java, many of them will stop being compatible with D8/R8, forcing Android developers to use pure Kotlin libraries. Then JetBrains needs to think how to make use of Java libraries that use the new FFI, virtual threads, inline classes, generics, SIMD vector types, while keeping the language compatible with what ART is capable of.
- chrisseaton 6y ago> due to that "strategy" People put scare quotes in seemingly at random these days - are you suggesting it's possibly not their strategy and actually they're lying? What do these scare quotes mean?
- moron4hire 6y agoThey are saying is not a very strategic strategy
- GordonS 6y agoI think Java took it too far. If they'd innovated at even 1/2 the rate of C#, I think they wouldn't have lost as much mind share. But of course, I'm sure Oracle is a big reason too.
- elygre 6y agoOracle is all the hate, but when it comes to java, Oracle really got the show rolling again. Prior to Oracle, little happened. After Oracle, a lot is happening.
- pjmlp 6y agoOracle haters seem to disregard that Oracle was the only company bothering to actually make an offer and keep it, without that offer, everyone would be busy maintaining Java 6 codebases, or porting code to something else.