Hacker News new | ask | show | jobs
by iainmerrick 2823 days ago
It does seem like all these .NET projects are reactions to rival technologies. C# is a Java clone, C# generics are an (arguably improved) Java generics clone, .NET Micro is J2ME, Silverlight is Flash, etc.

What are some examples of where C# / .NET paved the way and others followed? Maybe popularizing async/await?

I’m definitely not claiming MS as a whole is always a follower. It seems like Direct3D led the way for the whole industry, for example.

4 comments

How come C# generics are a copy of Java when they were invented first and the only reason they didn't make it to 1.0 was not to delay the release schedule?

Java annotations are based on .NET atributes, and initially had a clusmy implementation requiring an annotations processing tool until they finally got integrated into javac.

LINQ paved the way to more FP acceptance among enterprise developers. Check "confessions of a language salesman" from Erik Meyer.

Also .NET always had AOT/JIT from the very beginning, whereas AOT was tabu at Sun and only commercial JDKs always had it as option.

Hang on, Wikipedia says Generic Java was 1998, generics were adopted in J2SE 5.0 in 2004, and C# 2.0 wasn’t released until 2005. Am I missing something? I’m sure there was cross-fertilization both ways but it seems like Java generics came first.

LINQ is a good one though, that’s definitely a .NET innovation.

Yes you are missing the remaining part of the sentence "the only reason they didn't make it to 1.0 was not to delay the release schedule".

Don Syme of F# fame was leading generics research since 1999, while they were designing the CLR, but it was clear they would have to delay 1.0 if they wanted to included them, so they just went ahead without them for 1.0 release.

https://blogs.msdn.microsoft.com/dsyme/2011/03/15/netc-gener...

https://blogs.msdn.microsoft.com/dsyme/2012/06/19/some-histo...

https://blogs.msdn.microsoft.com/dsyme/2012/06/26/some-more-...

Additionally C#, like Java, also had CMU, ML, Ada, Eiffel, Sather, BETA, C++ and Modula-3 as possible sources of inspiration for generics.

Just lost out in a photo finish, then (over a span of 5 or 6 years...!)

But Generic Java was started in 1998 (IIRC originally as part of Pizza). It seems reasonable to say that Java covered this ground first.

Faire enough I forgot about Pizza.

Although what Java got wasn't all of Pizza, which had better generics.

If you trust Wikipedia for your answers, I have a bridge to sell you.
Combined with other sources, and when it fits with my own recollection, sure.

I played around with Pizza (AKA Generic Java) in the late 90s, before the launch of C#.

> C# generics are an (arguably improved) Java generics clone

That one at least is incorrect - C# had generic types long before Java

I didn’t know that, thanks for the correction! (Edit: although now I’m not sure I was wrong after all; see my reply to the other comment)

I had the wrong idea because (if I understand right) C#’s generic collections seem to be a copy of Java’s (which in turn were inspired by C++’s STL). Do I have that one the right way round?

The C# collections use generally poorer name choices (e.g. IEnumerator, which does not actually enumerate the elements) so I assumed they wanted to avoid making it identical to Java.

Java's collections are not much like STL (and pre-date Java generics) and important implementation details of generics in C++, C# and Java differ very substantially.
They are not very similar in implementation due to the nature of the languages. But the idea that it would be useful for the Java standard library to provide flexible, extensible, general-purpose containers (as opposed to ad-hoc stuff like Vector and Hashtable) was inspired by the STL.
I don't think that's accurate or that the general idea comes from STL. STL itself is a very particular kind of design.
What’s a good example of a really flexible, composable containers library that predates STL?

I think STL was the first mainstream one. I guess some of the ideas came from Ada? But I don’t know if Ada had standardized containers.

> C# generics are an (arguably improved) Java generics clone

That depends on who you ask.

My opinion is Java doesn’t have proper generics. In Java they’re just language-level syntactic sugar.

Type system is broken i.e. type information is lost at compile time. This makes it hard to do functional-style programming in Java, that’s why other people made Scala.

Performance is broken too, generic containers box everything into objects causing huge performance penalty for containers with value types.

that’s why other people made Scala

I think you mean “the same people”, at least in the specific case of Martin Odersky. :)

> Generics in the runtime not the compiler (c# 2)

> Functional deeply integrated into a mainstream language (LINQ c# 3)

> Unified graphical application model incorporating all main styles of web, forms, svg, and 3d. (WPF .net 3.5)

> Compiler language services (c# 5)

> Async await (c# 5)