7 ms·
<sarcasm>what's with all the Microsoft shills on HN lately?</sarcasm> I love C#. I have a project right now built in it. Everybody talks async/await--which is
by moron4hire 13y ago
<sarcasm>what's with all the Microsoft shills on HN lately?</sarcasm>
I love C#. I have a project right now built in it. Everybody talks async/await--which is certainly great--but there is a lot to love in C# and .NET that have been there for a long time. Real generics. The reflection libraries are outstanding and extent easy to use. Dynamic assembly loading is just downright awesome and also easy to implement. I could go on, but there is a beer in front ooh me getting warm.
- sz4kerto 13y agoReal generics are almost as addictive as C# templates - i.e. after going back to Java, you feel the pain _every single day_.
- jbrechtel 13y agoIn what way, specifically, do you feel this pain?
- alkonaut 13y agoReflection showing erased types. Slow collections because internal arrays are object[]. Various caveats with bridge methods/ClassCastExceptions. The list goes on and on. Erasure isn't a pragmatic design decision, it's an utterly and fundamentally broken design. Reified generics are both simpler to implement AND more performant AND more powerful in terms of metaprogramming. I fail to see the argument for erasure apart from backwards compatibility (which isn't really an argument).
- deleted 13y ago[deleted]
- bad_user 13y agoI liked C#, but everything changed after I picked up Scala.
- gngeal 13y agobut there is a lot to love in C# and .NET that have been there for a long time. Real generics. Real generics, as in generic programming? As in, this: http://www.haskell.org/haskellwiki/Research_papers/Generics http://www.haskell.org/haskellwiki/Research_papers/Generics ? The last time I saw C# (2.0?), it only had simple parametric polymorphism.
- profquail 13y agoTo be fair, very few languages have type systems as powerful as Haskell's ;) You're right though -- the .NET CLR type system (specified in ECMA-335) basically supports only a simple form of parametric polymorphism with subtyping constraints, along with co- and contra-variance. The idea is to allow some limited forms of generic programming while keeping the type system simple enough that it doesn't impose significant overhead during JIT compilation. Another advantage, is that it allows the JIT compiler to generate type-specialized code, which offers a significant performance advantage for unboxed value types. The F# type system is a little more powerful, though anything it offers beyond what the CLR officially supports gets erased when the program is compiled (e.g., unit-of-measure types). See: http://msdn.microsoft.com/en-us/library/vstudio/dd548046.aspx http://msdn.microsoft.com/en-us/library/vstudio/dd548046.asp... One interesting thing I've realized recently is that F# could potentially support GADTs in the future, just like Haskell and OCaml. The hard part -- the GADT type inference -- would take place at compile time, so there shouldn't be any problems encoding the result (the inferred type) in the CLR's type system. If you're interested in type systems (and as a Haskeller, I imagine you are), there's also F* -- it's a dependently-typed variant of F# which is being used for verification research at MSR: https://research.microsoft.com/en-us/projects/fstar/ https://research.microsoft.com/en-us/projects/fstar/
- gngeal 13y agoIf you're interested in type systems (and as a Haskeller, I imagine you are) Bah! Interested, definitely yes, but I share Alan Kay's point of view that "I like type systems but I don't know any that doesn't suck", so in this particular area, I'm a bit of a Luddite. (I'm much more of a lisper in heart.)