You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are things that I found annoying writing a complex library in Kotlin. While I am also a Scala developer, these
should not necessarily be juxtaposed w/ Scala (even if I reference Scala) as some of my annoyances are with features
that Scala doesn't even have. This is also not trying to be opinionated on whether Kotlin is good/bad (for the record, I
think it's good). I have numbered them for easy reference. I can give examples for anything I am talking about below
upon request. I'm sure there are good reasons for all of them.
Arrays in data classes break equals/hashCode and ask you to overload it. If you are going to need to overload it and
arrays have no overridability, why not make the least-often use case (the identity-comparison equals) the exception?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is what the [official documentation][1] says about the terminate/2 callback for a gen_server:
This function is called by a gen_server when it is about to terminate. It should be the opposite of Module:init/1 and do any necessary cleaning up. When it returns, the gen_server terminates with Reason. The return value is ignored.
Reason is a term denoting the stop reason and State is the internal state of the gen_server.
Reason depends on why the gen_server is terminating. If it is because another callback function has returned a stop tuple {stop,..}, Reason will have the value specified in that tuple. If it is due to a failure, Reason is the error reason.
A bit of background on compilers exploiting signed overflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters