ec
02/15/2020, 8:32 PMtypealias SessionId = String
typealias TopicName = String
fun unsubscribe(who: SessionId, from: TopicName) {..}
fun subscribe(to: TopicName, handler: (Topic) -> Unit)
Leon K
02/15/2020, 9:08 PMghedeon
02/15/2020, 9:09 PMdarkmoon_uk
02/15/2020, 11:44 PMAdam Powell
02/16/2020, 2:34 AMtypealias
. It gives no additional type safety but obscures the actual type and associated information from people reading the signature. It increases both complexity and ambiguity. You would gain the benefits from giving better names to the function parameters, e.g.
fun unsubscribe(sessionId: String, topicName: String)
without losing the type information and making the reader go look at the definition of the unfamiliar types.Adam Powell
02/16/2020, 2:35 AMghedeon
02/16/2020, 8:19 AMAccelerate
metrics (highly recommend this book) it increases your lead time for changes. Simply: extra "wrapping" code brings complexity and coupling which increases cognitive load and slows you down because changes take longer.Leon K
02/16/2020, 8:49 AMnwillc
02/16/2020, 8:15 PMLeon K
02/16/2020, 9:20 PMvsosnin
02/17/2020, 12:38 AMvsosnin
02/17/2020, 12:41 AMhighly recommend this book?
ghedeon
02/17/2020, 7:47 AM