Re:From Java to Go, and Back Again (2016)
by mercurial on Saturday June 23, 2018 @03:47PM
(#17383055)
There is nothing particularly outstanding about C#'s type system. It has reified generics and some basic type constraints, but so what? No option type, no ADTs, no pattern matching... Working with Typescript at the same time, I feel crippled every time I need to do something in C#. Not that Typescript is perfact, but its type system (especially with `strict`) is considerably more sophisticated.
It has basic pattern matching now, nullable is the option type, which is being extended to reference types in the next version. It's no Scala, but it's getting there.
Re:From Java to Go, and Back Again (2016)
by wpdev_63 on Saturday June 23, 2018 @05:09PM
(#17383465)
If you really care about all those features then you would just use kotlin. It works almost seamlessly with Java and has the best ergonomics of any language I have ever used. All those festures are in kotlin and then some.
LINQ -> streams, QueryDSL, RxJava, JOOQ etc
Async/await -> Comsat/Quasar
The type system is lightyears better in C# but it was rare that I needed those features. Usually you can hack around the limitations and end up with something (slightly cruftier) that does the same thing in Java. Mockito, Retrofit, and RxJava are good examples of hacking about the type system until you have something good enough. That said, there are definitely times I still miss C#'s stellar type system. Easily the best of any language I've touched besides maybe Typescript (which is designed by the same guy)