by Nullabillity · 6y ago · 0 comments
The content is bad: Quick, is System.DateTime[0] timezone-aware? The examples also use (the harmful and bug-prone) DateTime.Now 5 times, while DateTime.UtcNow is only mentioned once, as a minor aside.
The structure is bad: Is something part of "Core", "Framework", "Standard", or "Platform Extensions"? It's particularly ridiculous that trying to switch from Core to Platform Extensions while you're viewing a Core class (such as System.DateTime[0]), you'll get kicked over to.. Framework.
The layout is bad: Look at System.DateTime's list of constructors[1]. It takes up a whole screenful to say what Python's datetime.datetime constructor[2] paragraph says in three lines.
The design is bad: Compare the method listing of .NET's IDictionary[3] to Scala's Map[4], or Rust's HashMap[5]. Which one makes the type signatures the easiest to parse? Which one helps you get where you want to the fastest?
(Hint: For me, at least, not the one that insists on making everything a uniform shade of baby blue.)
[0]: https://docs.microsoft.com/en-us/dotnet/api/system.datetime?...
[1]: https://docs.microsoft.com/en-us/dotnet/api/system.datetime?...
[2]: https://docs.python.org/3/library/datetime.html?highlight=da...
[3]: https://docs.microsoft.com/en-us/dotnet/api/system.collectio...
[4]: https://www.scala-lang.org/api/current/scala/collection/immu...
[5]: https://doc.rust-lang.org/stable/std/collections/struct.Hash...
For a similar example, Scala's old collections library had a ton of machinery to ensure that `map` and co. would specialize correctly.[0] But the user never sees that, because they added a mechanism called "use cases", that allow you to override the signature shown in the docs with a simpler one.[1]
[0]: https://github.com/scala/scala/blob/v2.12.10/src/library/sca...
[1]: https://www.scala-lang.org/api/2.12.10/scala/collection/immu...