8 ms·
Why did Microsoft create C#? Wasn't Java good enough in the 1990s?
- midnitewarrior 9y agoThey created Visual J++ because Java scared them and also because Java didn't work very well with Windows. Sun Microsystems sued them and Microsoft had to deprecate Visual J++ and its runtime. They created C# because they wanted a native language for their .NET runtime that integrated seamlessly with Windows. It was obvious that cross platform runtimes were going to be the future and Microsoft couldn't depend on an outside company to drive the technology platform they would be relying on.
- cm2187 9y agoAlso I understand they wanted to use it for all sort of windows internal libraries (which they ultimately did with .net). I can understand why they would want full control of it.
- andyczerwonka 9y agoIMO, it's pretty straight-forward. They created it because of Java. If Java doesn't exist, C# doesn't exist.
- pryelluw 9y agoThey also didn't own or control C++. Ownership is extremely important for market control.
- pjmlp 9y agoActually they at least control the C++ improvements that they are able to drive through the ANSI C++ work. Only the companies that are willing to sponsor ANSI C++ work, do have anything to say to what happens to C++, same applies to any other ANSI language, including C.
- RickJWag 9y agoYep, that's how I see it, too.
- pjmlp 9y agoPity Sun had run out of money when Android came out. https://www.youtube.com/watch?v=ZYw3X4RZv6Y&feature=youtu.be&t=57m42s https://www.youtube.com/watch?v=ZYw3X4RZv6Y&feature=youtu.be...
- curtis 9y agoJava most definitely was not good enough in the 1990s. It's true that C# 1.0 was very close to a Java clone it still added a couple of very nice improvements such as value types and ref and out parameters making it much easier and cleaner to return multiple values from a method. Features like these didn't add much complexity to the language, and greatly improved the ergonomics. Sun could have (and should have) copied them in Java, and I don't know why they didn't.
- coding123 9y agoI know the general answer to that last statement had always been that Sun was also a slave to the JCP - they put a lot of control in that group. Oracle quickly dismantled that and is now actually improving the language.. however it seems to be losing ground anyway with people embracing other tech for the server now.
- pjmlp 9y agoOn our European enterprise projects, I haven't seen any change on the Java/.NET kind of projects.
- olavk 9y agoJava wasn't good enough...but that was not the reason MS created C#. They were very scared of Java at the time, and their attempt to "embrace and extend" failed. So they created their own language. Out and ref was not a clean way to return multiple values - they are actually a pretty ugly way to return multiple values. (Tuple unpacking is the clean way, but that has only recently been added.) Out and ref was added because C++ API's had call by reference, and MS wanted to make integrating with windows API's easier. I suspect value types (structs) were added for the same reason. That said, C# did end up a much better language than Java, especially with later improvements like generics and Linq.
- curtis 9y ago> (Tuple unpacking is the clean way, but that has only recently been added.) Oh, I agree with you there, but that doesn't change the fact that ref/out parameters were a much, much better than the way Java forced you to do it. I don't mean to imply that C# 1.0 was a good language even for the 90s, but it was a big practical improvement over Java. I think C# 2.0 is the first point where someone could make the claim that it was actually a good language, at least for that era.
- redleggedfrog 9y agoAs 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.
- samfisher83 9y agoMicrosoft got sued by sun so they got rid of their VM and made C#. C# copied java, but its evolved and now has a lot of cool features.
- pjmlp 9y agoJava also ended up copying quite a few features of C# back. - Boxing - annotations - StringBuilder - LINQ - var (coming with 10)
- Max-q 9y agoAnnotations are a Java innovation. Edit: this is not correct. My bad.
- pjmlp 9y agoC# Attributes were introduced in .NET 1.0. Released in 2002. Betas were available already during 2001. Java annotations started to be discussed in 2002, with JSR-175, finally delivered with Java 1.5, released in 2004. So how come it is a Java innovation?
- Max-q 9y agoYou are absolutely right. My bad.
- polskibus 9y agoHow does Java linq look like?
- looperhacks 9y agoI think he's referring to the Stream-API
- pjmlp 9y agoIt is the Stream API.
- deleted 9y ago[deleted]
- KamBha 9y agoI have never really coded in C# or in the .Net platform, but I remember when it came out. I always thought that prior to C# 1.0 being released, the Java language was stuck. There was no generics, annotations, enumerations, for/each loops or auto boxing which made programming in Java not only painful but dangerous (especially with the lack of generics and for/each). I personally, never considered anything before Java 1.5 "good enough". I was always under the impression that these language change were in response to what C# and many of these language concepts were practically copied from C#. Is this actually the case?
- DonHopkins 9y agoIn the case of generics, C# got them right (but required changes to CLR 2.0) and then Java tried to copy the idea (without requiring any changes to the JVM) but fucked them up. Look up "type erasure": Java's underlying compiled classes weren't actually generic, and generics compiled down to "Object" and casts (which are less efficient, and can be subverted at runtime). Generics were implemented by the Java compiler, not the JVM runtime. https://stackoverflow.com/questions/31693/what-are-the-differences-between-generics-in-c-sharp-and-java-and-templates-i#31866 https://stackoverflow.com/questions/31693/what-are-the-diffe... https://stackoverflow.com/questions/355060/c-sharp-vs-java-generics https://stackoverflow.com/questions/355060/c-sharp-vs-java-g... http://www.jprl.com/Blog/archive/development/2007/Aug-31.html http://www.jprl.com/Blog/archive/development/2007/Aug-31.htm... http://www.artima.com/intv/generics2.html http://www.artima.com/intv/generics2.html https://blogs.msdn.microsoft.com/ericlippert/2009/07/30/whats-the-difference-part-one-generics-are-not-templates/ https://blogs.msdn.microsoft.com/ericlippert/2009/07/30/what...
- stmw 9y agoI am glad you're pointing this out, because the limitations of the JVM are often overlooked as a big reason for why "we can't have nice things" in Java.
- pjmlp 9y agoThe Pizza compiler had better generics support. http://pizzacompiler.sourceforge.net/ http://pizzacompiler.sourceforge.net/ But then only part of it was taken back into Java.
- lafar6502 9y agoBecause they wanted to decide for themselves
- pritambarhate 9y agoC# and Java. From Open Source standpoint and with Android adoption Java was/is ahead. However, things are changing again. Oracle has announced that they will give free support to Java releases only for six months. It makes JVM a risky, unstable and potentially unsafe platform to develop on. On the other hand, MS is putting a lot of effort to make C# open and to make it run on all platforms. Both the languages and platforms are very good. But right now there is more influential OSS (HBase, Cassandra, Kafka and many others) stuff in Java. However, I wonder with Oracle's new stance, if C# will become the preferred language for Open Source. Or Maybe Go will leave both Java and C# behind.
- lc94 9y agoThat's hyperbole. Yes the releases are now every 6 months, but there are still long-term releases that have support for at least 3 years. The bi-annual releases aren't for companies to upgrade to every 6 months but for power users who like to experiment and try out new bleeding edge features. Same as with Ubuntu releases for example.
- pjmlp 9y agoThat is not correct, 6 months support is for the releases that aren't LTS. LTS releases are three years. Without generics, GUI toolkits, good quality SQL drivers from the vendors themselves, enterprise frameworks and the IDE quality of Java and C#, Go will never be an actual threat to them. Go 2.0 might be, if it ever happens.
- pritambarhate 9y agoYes, I know about LTS releases. But upgrade time from one LTS to another LTS is only 3-4 months. Check [1]. For JDK8 for people using it for commercial purpose, the updates will stop in Jan. 2019 only after 4 months since new JDK 11 LTS release. According to Wikipedia [2] same period for JDK 7 to JDK 8 was 1 year. Also on the same Wikipedia page, you can see how many bugfixes JDK 8 received in that 1 year. So JDK8 to JDK 11 release is also going to be a little bit risky as people will need to depend only on 3-4 months stability reports to upgrade their production deployments to JDK 11. [1] http://www.oracle.com/technetwork/java/eol-135779.html http://www.oracle.com/technetwork/java/eol-135779.html [2] https://en.wikipedia.org/wiki/Java_version_history https://en.wikipedia.org/wiki/Java_version_history
- chvid 9y agoFunny thing. After all these year it actually seems like Java now has the upper hand. It is an open platform. You are just as productive as a developer on Unix and Mac OS X as you are on Windows. The "toolchain" with things like Maven, build and dependency management, is well-defined and not buggled into a big IDE like it is on C#. Deploying on Unix is a standard thing, not an experimental feature. And finally there is Android. Sure Java as a langage is more conservative but the differences are not that big. And there are alternatives like Scala or Kotlin for those want and they seem to be a minority.
- SideburnsOfDoom 9y ago> It is an open platform. You are just as productive as a developer on Unix and Mac OS X as you are on Windows. How is that any different from .Net core? Open platform, check (1) productive on those platforms, check (2) > buggled into a big IDE like it is on C#. Nope. dotnet cli is fine standalone (3) > Deploying on Unix is a standard thing, not an experimental feature. Um, it might be fairly new but I would not call that platform target "experimental" any more. It's in version 2 now > And finally there is Android. Yes there is. I know teams that write in C# for Android and iOS. (4) C# is late to the party in this regard. But what you are saying isn't correct. 1) https://github.com/dotnet https://github.com/dotnet 2) https://code.visualstudio.com/ https://code.visualstudio.com/ 3) https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet?tabs=netcore2x https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet?ta... 4) https://www.xamarin.com/ https://www.xamarin.com/
- chvid 9y agoJava is the primary development langauge for Android. You can't really compare that to the stuff you are listing. Can I run Visual Studio on my macbook? Does any of the companies developing webapps in C# actually deploy on Unix? MS might aspire to have that broadness of platform but it is not actually there. It is in the Java world.
- SideburnsOfDoom 9y ago> Can I run Visual Studio on my macbook? Visual Studio Code, yes. People do that. I see it at my employer. But ultimately it's not tied to a particular IDE. You could e.g. use JetBrains Rider (1) on your mac. You could use the likes of Sublime text, the command line tools and a plugin (2) if you want. > Does any of the companies developing webapps in C# actually deploy on Unix? Some of them do yes, and more of them will. AWS Lambda functions too. (3) I see both of those (.Net core web apps and lambda functions) at my employer. > MS might aspire to have that broadness of platform Correct, this a fairly new aspiration > but it is not actually there. You know, it's ok to say "I don't actually know that particular technology very well, I'm not keeping up to date with recent developments in that space." Nobody tracks everything. You don't have to make strong statements about things that you don't know much about. 1) https://www.jetbrains.com/rider/ https://www.jetbrains.com/rider/ 2) http://www.omnisharp.net/ http://www.omnisharp.net/ 3) https://aws.amazon.com/blogs/developer/aws-lambda-net-core-2-0-support-released/ https://aws.amazon.com/blogs/developer/aws-lambda-net-core-2...
- jcoffland 9y agoMicrosoft created J++ which was Java but with extensions that only worked on Windows. In Visual Studio, these extensions were enabled by default so programmers were unwittingly writing software that only worked in Windows thinking they were writing cross platform Java code. This was a very sneaky move that went totally against Java's write once, run anywhere moto. Microsoft was sued and a judge ruled against them. They were forced to disable the Microsoft only extensions in Visual Studio and warn developers that they were creating Microsoft specific code when the extensions were enabled. Microsoft got mad, went home and broke all their toys. Next day they came back with C#. https://www.cnet.com/news/sun-microsoft-settle-java-suit/ https://www.cnet.com/news/sun-microsoft-settle-java-suit/
- stmw 9y agoJava was far less open back then than it is now, and this lawsuit is a good example.. There was even a question whether you could have a clean room JVM implementation at all.
- stmw 9y agoI was involved in some of the first non-Sun java VM implementations and spent some time at Microsoft. The quick list of major reasons: 1. competition between Microsoft and non-Microsoft camps 2. Java was far less open in the 90's than it is now 3. .Net/C# is a better language and runtime,(e.g. how it deals with native code, designed for JIT compilation from the start, created with multiple languages in mind)
- deleted 9y ago[deleted]