Live data from Hacker News

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

quora.com

81–87 of 87 posts

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

#81
post #23
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…

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

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

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

#82

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…

To give the opposite view:

I'm glad they don't throw everything and the kitchen sink into Java. There's so many keywords in C# that are really not necessary, yet you need to learn them, because you can be sure, you'll run into some codebase where some advanced C# dev used all of those features anyways. This is the reason why people find C++ intimidating and why there's probably hundreds of unofficial subsets of it, which are supposedly better.

It slows down people who are new to the language, is annoying for people switching back and forth between languages and adds additional mental complexity even for people who frequently use the language.

And as for the IDE, that may be true, if you happen to like Visual Studio (and don't want to dev on Linux), but if you don't like it, then your options are rather limited.

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

#83

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…

> Joy had the handicap of going first, and Java has some choices that reflect that. As a sidenote: Microsoft actually willfully copied some of those to their side, too (e.g. covariant arrays). Having worked with C++ (which has its own set of problems, of course), I repeatedly find language design decisions that strike me as inelegant hacks in both of them (getting rid of `const`, for example). From today's perspectiv…

> the biggest contribution both languages have made for the future are their respective runtimes and that they allow new languages to adopt those (Clojure, Scala, Kotlin, F#...)

I'd say that's true of the JVM, where independently developed high-adoption languages Kotlin and Scala have flourished, but not so of the CLR, whose only "new" language of any import is F#, developed by Microsoft themselves and kept in step with C#.

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

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

Yes there is a version of Visusl Studio for the Mac and Visual Studio Code. There is also the excellent JetBrains Rider.

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

#85
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)

Java didn't copy Linq. It copied Linq syntax. Linq is not just about syntax it's about expression trees or "code as data".

http://www.dotnettricks.com/learn/linq/understanding-express...

A Linq expression can be translated at runtime to allow the same code to be tranlated to Sql for an RDMS , MongoQuery, or anything else that you write a provider for.

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

#86
post #70
post #65

Earlier quoted context omitted.

For me the highlights of C# 1.0 vs Java at that time was multiple classes per file or partial classes in C# vs Java's one file=one class Easy default way to build, debug and run apps Familiar way to create GUIs ASP.net (it wasn't perfect but hey) compared to JSP No properties boilerplate Enums Visual Studio 2003 vs Eclipse or Netbeans at that time on the hardware at that time was no competition

Mostly agree, but partial classes were a far later addition

Ah you're right, they were added in C# 2.0. I wasn't sure about them but was too lazy to check. I don't even remember how was auto generated code handled? Was it in a collapsed region?

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

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

I think C# is lucky in a way. It's getting old and bloated at a moment in history when modern is essentially synonymous with being a convoluted multi-paradigm monster gobbling up features and syntactic sugar at a frantic pace. Even the Go crowd has made the first step towards quantum computing, leaving behind errno in favor of returning both a possibly invalid return value and an error that can be nil and non-nil at…

that last bit sounds terrifying.
Post reply on HN