3 ms·
Yeah, I find the “xs = append(xs, x)”, or for concat, “xs = append(xs, ys...)” supremely ugly. Or, its time module: you can write 3 * time.Second, which is rea
by xyzzyz 5y ago
Yeah, I find the “xs = append(xs, x)”, or for concat, “xs = append(xs, ys...)” supremely ugly. Or, its time module: you can write 3 * time.Second, which is reasonable enough, but when you have a variable instead of constant literal, you need to write time.Duration(x) * time.Second — entire expression represents the time interval of 3 seconds, but the “time.Duration(x)” component of it makes no sense at all in isolation - it’s just horrible API design. Also, its time zone API is atrocious too: it doesn’t distinguish absolute timestamps from local (wall clock) time on the type level.
Saddest part is that it’s actually pretty good language at getting things done, you just have to hold your nose and pretend it was invented in early 1980s, before the industry figured out good, clean solutions to many problems, and converged on them. Otherwise, to think that someone thought nil (that is, not empty) arrays, or returning value/error as pair instead of tagged result union, or lack of generics, is a good idea on 2000s, is just unconscionable.