5 ms·
As someone who has worked with both Java and C#, I would say while Java might have been "good enough" it's lacking when compared to C# across the board. Micros
by redleggedfrog 9y ago
As someone who has worked with both Java and C#, I would say while Java might have been "good enough" it's lacking when compared to C# across the board. Microsoft has consistently improved the language ahead of Java, with new technology like generics (or properties, but you could argue about that one). Also, the development environment for C# is much better than whatever you can cobble together for Java.
I think much of the difference comes from the nature of the language designers and the timing of the language's creation. Joy had the handicap of going first, and Java has some choices that reflect that. Hejlsberg got to look at the weakness of Java to make C#. Overall, I think the practical approach to C# makes it a more useful language than Java, where Joy has some definite philosophical baggage he's carrying around that is reflected in Java.
Note we're talking a fairly fine gradation here. If you need to work in either, you're not slumming.
- pjmlp 9y agoI work with both, and while I also don't like the pace Java gets its improvements, I understand them, given how many companies allow us to update to modern versions. My work computer has Java 9, .NET 4.7.1 and C++17 compilers installed. Usually I get to deploy on Java 8 (only allowed last year), .NET 4.5 (as of last year) and C++ enterprise code looks mostly C with C++ compiler. So I don't mind the slow pace, given that I can only use the very latest features on private projects.
- vorg 9y ago> C++ enterprise code looks mostly C with C++ compiler This seems to be the dirty little secret of C++ programming. It seems any corporate site that decides to go serious with Object Orientation also decides to do Managed Memory, and switches to Java or C#, and lately maybe even Go.
- btschaegg 9y agoTo be fair, if you're using C++ for a standard, run off the mill corporate solution nowadays, that's probably a "wrong tool for the job" kind of situation anyway.
- earenndil 9y ago> I also don't like the pace Java gets its improvements Apparently they're now moving to a 6-month release cycle.
- pjmlp 9y agoYep, looking forward to them.
- DonHopkins 9y ago>Hejlsberg got to look at the weakness of Java to make C#. Not only that, but Sun actually had a culture of refusing to look at what other companies like Apple and Microsoft had done because of their pre-conceived notion that it was inferior, and proudly scoffing at and ignoring other technology instead of carefully studying it and learning from its strengths and weaknesses like Microsoft shamelessly did. When I worked at Sun in 1990, Macs were considered useless toys (while PCs were considered useless, but not fun enough to be toys), and you had to get special permission to bring a rented Mac into the building to work on -- they wouldn't buy them, so you had to buy one yourself and keep it at home if you wanted to know what Apple was up to.
- gaius 9y agoMacs were considered useless toys And then Apple supplanted Sun as the biggest Unix workstation vendor on the planet, pretty ironic! Back in the 90s I did most of my Java on Mac, using the excellent Metrowerks Codewarrior environment. It was considerably more productive than NetBeans (or whatever it was called then, I forget) on the Ultra-10 I also had on my desk. Writing was on the wall for Sun even then...
- pjmlp 9y agoSometimes I wonder how things would have looked like if they actually went forward with OpenStep. Netbeans was always called like that I think. I just remember before version 3.0, the UI was quite different, and there was this strange concept of having to mount directories to see them on the IDE.
- DonHopkins 9y agoThe other mistake that Sun made with Java was its linguistic supremacist "100% Pure Java" propaganda campaign: you should rewrite all of your code in Java instead of expecting Sun to provide you with easy seamless interoperability with existing languages and libraries. So Sun's JNI and applet web browser integration languished while Microsoft integrated COM and CLR for seamless interoperability with the web browser and other languages like C++ into Java and CLR. Sun also had an unholy obsession with code generation, since their attitude was to breed as much 100% Pure Java Code into the world as possible (see AspectJ, JAXB, etc). While C# took a much better approach of supporting code annotation and metadata and reflection and bytecode generation at runtime so you didn't actually have to generate and compile a huge pile of boilerplate source code (see PInvoke). https://docs.microsoft.com/en-us/cpp/dotnet/how-to-call-native-dlls-from-managed-code-using-pinvoke https://docs.microsoft.com/en-us/cpp/dotnet/how-to-call-nati... http://www.pinvoke.net/ http://www.pinvoke.net/
- cm2187 9y agoI wonder if we are not close to the end of C#’s useful life. It’s a great language but it has become so convoluted with dozens of way to do the same thing, largely due to improvement that came along the way. Like methods accepting objects coexisting along methods accepting generics. Old async syntax (callbacks) along task async, like out and ref parameters now that we have valuetuples, etc. I wonder if .net core isn’t a missed opportunity to clean up the language.
- dtech 9y agoIf .net broke backwards compatibility it would be even harder for it to gain traction. See python 2 -> 3 etc.
- cm2187 9y agoBut at the risk of being overshadowed by a newer, simpler language. Which is kind of what is happening now with python (it's not newer but its simplicity is giving it a lot of traction).
- helthanatos 9y agoThere's a risk of being confused on how to do things with backwards compatiblity, but it's something that makes me like c# better than other languages. Being able to add new features without removing old features is great. Older examples of c# may look completely different than new examples but that is great because someone can continue without learning all the new stuff (kind of odd, but eh). Removing old functionality could doom them because they already have a lot of confusing dependencies when using part .net core, part .net 4.5. They don't support newer versions of .net on the old windows 10 versions, making support complete Hell as far as that is concerned. I think cleaning up documentation and old examples some would make the evolution of the language easier but isn't strictly necessary to still be useful. Even in strict enterprise, though it may be annoying.
- fauigerzigerk 9y agoI think C# is lucky in a way. It's getting old and bloated at a moment in history when modern is essentially synonymous with being a convoluted multi-paradigm monster gobbling up features and syntactic sugar at a frantic pace. Even the Go crowd has made the first step towards quantum computing, leaving behind errno in favor of returning both a possibly invalid return value and an error that can be nil and non-nil at the same time! ;-)
- cpr 9y agoI’m sure it’s a slip of the tongue, but you don’t mean Bill Joy but rather Jim Gosling.
- btschaegg 9y ago> Joy had the handicap of going first, and Java has some choices that reflect that. As a sidenote: Microsoft actually willfully copied some of those to their side, too (e.g. covariant arrays). Having worked with C++ (which has its own set of problems, of course), I repeatedly find language design decisions that strike me as inelegant hacks in both of them (getting rid of `const`, for example). From today's perspective, I'd say that the biggest contribution both languages have made for the future are their respective runtimes and that they allow new languages to adopt those (Clojure, Scala, Kotlin, F#...) without having to throw away all of your codebase at once.
- vorg 9y ago> the biggest contribution both languages have made for the future are their respective runtimes and that they allow new languages to adopt those (Clojure, Scala, Kotlin, F#...) I'd say that's true of the JVM, where independently developed high-adoption languages Kotlin and Scala have flourished, but not so of the CLR, whose only "new" language of any import is F#, developed by Microsoft themselves and kept in step with C#.
- Sylos 9y agoTo give the opposite view: I'm glad they don't throw everything and the kitchen sink into Java. There's so many keywords in C# that are really not necessary, yet you need to learn them, because you can be sure, you'll run into some codebase where some advanced C# dev used all of those features anyways. This is the reason why people find C++ intimidating and why there's probably hundreds of unofficial subsets of it, which are supposedly better. It slows down people who are new to the language, is annoying for people switching back and forth between languages and adds additional mental complexity even for people who frequently use the language. And as for the IDE, that may be true, if you happen to like Visual Studio (and don't want to dev on Linux), but if you don't like it, then your options are rather limited.