Live data from Hacker News

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

quora.com

51–60 of 87 posts

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

#51
post #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’…

If .net broke backwards compatibility it would be even harder for it to gain traction. See python 2 -> 3 etc.

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

#52
post #51
post #50

Earlier quoted context omitted.

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

If .net broke backwards compatibility it would be even harder for it to gain traction. See python 2 -> 3 etc.

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

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

#53
post #47

Earlier quoted context omitted.

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

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

2) http://www.omnisharp.net/

3) https://aws.amazon.com/blogs/developer/aws-lambda-net-core-2...

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

#54
post #40
post #15

Earlier quoted context omitted.

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

> In principle if you want to return multiple values from a method, you can return them in an array

This is not viable. If I want to return e.g. an (error) code and string, the only Array you can put that in is an array of the root type (Object), losing all type-safety.

In C# and Scala multiple return values use a Tuple class, with some syntactic sugar to easy create and read them. It will eventually be in Java [1], it just takes decades.

It also has very little to do with the optimizer, there's not reason why the JVM couldn't support & optimize it.

[1] http://openjdk.java.net/jeps/305

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

#55
post #47

Earlier quoted context omitted.

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

> Can I run Visual Studio on my macbook?

There is Visual Studio For Mac [1], though I'm unsure how it compares to Visual Studio "proper".

[1] https://www.visualstudio.com/vs/visual-studio-mac/

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

#56
post #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’…

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

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

#57
I 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)

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

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

IMO it's completely inferior to LINQ in C#. One of the main reasons being that Java still lacks extension methods, so you're stuck with the methods that are provided for you. In C#, if I want a Dedupe in my LINQ method call chain, I can simply implement it myself.

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

#59
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,…

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

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

#60

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

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