Live data from Hacker News

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

quora.com

41–50 of 87 posts

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

#41

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…

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

http://www.pinvoke.net/

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

#42
post #25
post #18

Earlier quoted context omitted.

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.

C# 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?

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

#43
post #18

Earlier quoted context omitted.

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?

It is the Stream API.

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

#44
post #13

Earlier quoted context omitted.

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…

> I also don't like the pace Java gets its improvements Apparently they're now moving to a 6-month release cycle.

Yep, looking forward to them.

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

#45
post #9
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…

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…

>MS wanted to make integrating with windows API's easier

Agreed: integrating with other languages was very important to Microsoft, but not to Sun with its "100% Pure Java" campaign.

See my other comment about that: https://news.ycombinator.com/item?id=16354176

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

#46
post #32

Earlier quoted context omitted.

> 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 agree. Those emails/PDFs released in the DOJ case very enlightening and proved a lot of what Charles Ferguson was talking about in his books, "Computer Wars", "High Stakes, No Prisoners". MSFT was even afraid of AOL, Oracle, and others teaming up to offer a home appliance (eg. a net PC) at low prices and undercutting the PC industry. Of course, those partnerships and alliances never did work out. Sun and Netscape h…

>Sun and Netscape hated each other, for example.

Ain't that the truth! The bitter irony is that a bunch of the Sun-hating Netscape programmers went over to AOL after the acquisition, just to be mis-managed into the ground by a bunch of "Alliance" managers from Sun.

https://www.cbsnews.com/news/aol-woos-netscape-employees/

>Case told the Netscape workers that after the merger is completed next spring, stock options will remain valuable, their sabbatical program will remain in place, and their corporate culture will remain intact.

>"Maybe you joined the company because it was a cool company," he said. "We are not changing any of that. We want to run this as an independent culture."

Pffff!!!

http://www.zdnet.com/article/a-year-ago-friction-behind-aol-...

>Netscape cancelled a project to develop a Java version of Netscape Navigator with Sun Microsystems Inc. because Netscape couldn't afford it, according to Kannegaard. Kannegaard's claims are at odds with the story Netscape told publicly about the reason it killed its so-called Javagator product. "It was explained to me that after Microsoft in their [Netscape's] words undercut their business, they could not afford to continue the project, so they had to reduce their engineering resources and cancel this project," Kannegaard said.

>That is not the story Netscape told the general public. According to a story in ZD Net's sister publication, PCWeek published Feb. 26, 1998, Netscape said it was pulling back on Javagator in hopes of getting help from Network Computer manufacturers such as Sun and Oracle Corp.

Meow!!!

https://www.cnet.com/news/aol-layoffs-slam-sun-netscape-alli...

>After the layoffs, iPlanet will largely be a Sun satellite. As of last July, only one-third of iPlanet's approximately 3,000 employees were from AOL, Sun Chief Financial Officer Mike Lehman said. Lehman has further said that Sun largely owns iPlanet's intellectual property.

Owch.

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

#47
post #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…

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

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

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

#48
post #32

Earlier quoted context omitted.

I agree. Those emails/PDFs released in the DOJ case very enlightening and proved a lot of what Charles Ferguson was talking about in his books, "Computer Wars", "High Stakes, No Prisoners". MSFT was even afraid of AOL, Oracle, and others teaming up to offer a home appliance (eg. a net PC) at low prices and undercutting the PC industry. Of course, those partnerships and alliances never did work out. Sun and Netscape h…

>Sun and Netscape hated each other, for example. Ain't that the truth! The bitter irony is that a bunch of the Sun-hating Netscape programmers went over to AOL after the acquisition, just to be mis-managed into the ground by a bunch of "Alliance" managers from Sun. https://www.cbsnews.com/news/aol-woos-netscape-employees/ >Case told the Netscape workers that after the merger is completed next spring, stock options wi…

Thanks for pointing that out.

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

#49
post #42
post #25

Earlier quoted context omitted.

Annotations are a Java innovation. Edit: this is not correct. My bad.

C# 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?

You are absolutely right. My bad.

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

#50

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 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.
Post reply on HN