Live data from Hacker News

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

quora.com

31–40 of 87 posts

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

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

I think he's referring to the Stream-API

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

#32
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 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 hated each other, for example.

Microsoft was even worried Sony would "take over" the home since game consoles were becoming as powerful as PCs. Flash forward a few years: when I used my brother's PS3 in 2010, I couldn't believe how awful the browser was on such a powerful machine.

Hollywood and media companies were also afraid of Microsoft in the 90s. MSFT was making deals with Dreamworks, NBC (ie MSNBC), and others. It really did seem like MSFT had the cash to takeover the world and charge fees everytime a movie needed to be distributed. At one point, early on, Bill Gates suggested people would pay a nickel or dime to view a website.

Then, in the low 2000s, when .Net came out, there was a slide that compared the PC desktop to the WWW. MSFT wanted to offer APIs/languages/abstraction layers for the WWW that were analogous to the MSFT desktop.

The same paranoia people had of MSFT/AOL/Oracle, continues, but the names have change to different companies.

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

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

> (Tuple unpacking is the clean way, but that has only recently been added.)

That's both accurate and a little misleading. Tuples are ten years old, they were added in 2009/10. However, improvements in syntax and cleaner unpacking have been recent additions.

In general though ref and out have taken a back seat to Tuples for years now in C#.

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

#34

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…

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

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

#35
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 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

2) https://code.visualstudio.com/

3) https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet?ta...

4) https://www.xamarin.com/

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

#36
Microsoft 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/

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

#37

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

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

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

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

> I also don't like the pace Java gets its improvements

Apparently they're now moving to a 6-month release cycle.

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

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

Your comment couldn't be more wrong. .NET Core is an open platform, and has been for some time, with its framework and runtime hosted on GitHub. .NET Core's toolchain is a simple CLI which integrates with many popular CI/CD solutions (e.g., TeamCity). .NET Core has been stable on several Linux distros for many months and can hardly be characterized as "experimental." C# has a cross-platform, lightweight editor in VSCode--no Visual Studio required.

I suggest you update your knowledge before spreading blatantly incorrect information like this.

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

#40
post #15
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…

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

The logic behind Java is that the language should not concern itself with technicalities, the JVM will take care of it. This principle goes both ways, the JVM can't optimize your code if you have already decided how it should behave. As i understood, that is why they never added the more technical features as MS did in C#. In principle if you want to return multiple values from a method, you can return them in an array, and in principle the JVM optimizer will take care of the array. That is in principle, i don't know how good the optimizer got in this regard.

But i still prefer Java for simplicity and readability.

Post reply on HN