Live data from Hacker News

Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

quora.com

21–30 of 87 posts

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#21
post #9

Earlier quoted context omitted.

Java 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 be…

> They were very scared of Java at the time This is an understatement, reading some of the antitrust documents you can clearly see that Microsoft was afraid that Java's ability to create rich programs that run regardless of OS would end up making Windows unnecessary since it wouldn't matter what OS you had. They saw Netscape as a distribution vector for Java and the JVM and was an important reason for why they made I…

I'm one of those who prefer HTML/CSS/JavaScript to Java applets! It is interesting that MS for a while heavily pushed JavaScript and dynamic HTML in order to undercut Java...until they belatedly realized they had creating something which was just as bad to the Windows lock-in.

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#22
I 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?

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#23
post #13

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…

I 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 t…

> 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.

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#25
post #18

Microsoft 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.

Java also ended up copying quite a few features of C# back. - Boxing - annotations - StringBuilder - LINQ - var (coming with 10)

Annotations are a Java innovation.

Edit: this is not correct. My bad.

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#26
post #4

Java 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…

Surely the "clean" way to return multiple values from a function is to support returning a tuple. The methods positional parameters already essentially constitute a tuple argument.

Such structural grouping of values however went against OOP dogma at the time, which dictated that every type must have a name. Even after generics were introduced into Java, Sun refused to add even a pair class to the JDK (IMHO the bug report was amusing reading). Perhaps they were also similarly opposed to C#'s features?

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#27
post #18

Microsoft 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.

Java also ended up copying quite a few features of C# back. - Boxing - annotations - StringBuilder - LINQ - var (coming with 10)

How does Java linq look like?

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#28
C# 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.

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#29
post #22

I 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…

In 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-diffe...

https://stackoverflow.com/questions/355060/c-sharp-vs-java-g...

http://www.jprl.com/Blog/archive/development/2007/Aug-31.htm...

http://www.artima.com/intv/generics2.html

https://blogs.msdn.microsoft.com/ericlippert/2009/07/30/what...

Re: Why did Microsoft create C#? Wasn't Java good enough in the 1990s?

#30
Funny 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.

Post reply on HN