What's wrong with C#?

  • null everywhere.
  • const nowhere.
  • APIs are inconsistent, e.g. mutating an array returns void but appending to a StringBufferreturns the same mutable StringBuffer.
  • Collection interfaces are incompatible with immutable data structures, e.g. Add in System.Collections.Generic.IList<_> cannot return a result.
  • No structural typing so you write System.Windows.Media.Effects.SamplingMode.Bilinear instead of just Bilinear.
  • Mutable IEnumerator interface implemented by classes when it should be an immutable struct.
  • Equality and comparison are a mess: you've got System.IComparable and Equals but then you've also got:
    System.IComparable<_> System.IEquatableSystem.Collections.IComparer System.Collections.IStructuralComparable System.Collections.IStructuralEquatable System.Collections.Generic.IComparer System.Collections.Generic.IEqualityComparer
  • Tuples should be structs but structs unnecessarily inhibit tail call elimination so one of the most common and fundamental data types will allocate unnecessarily and destroy scalable parallelism.

    Comments

    Popular posts from this blog

    Bjarne Stroustrup is catching up

    Does reference counting really use less memory than tracing garbage collection? Mathematica vs Swift vs OCaml vs F# on .NET and Mono

    Does reference counting really use less memory than tracing garbage collection? Swift vs OCaml