Re:Please put units in names
by y3sh on Tuesday March 22, 2022 @08:27AM
(#30765211)
The Go compiler is also happy with time.Sleep(1000), which the new "expert full stack" dev just PR'd.
To me Durations are a zero sum gain, because in this case they hide relevant detail (int64 nanoseconds) without enforcing usage. Compare it against what Golang could easily provide -- time.SleepMilli(100), which is 40% less characters for my aging eyes to parse than time.Sleep(100 * time.Millisecond).
After all, in the very same package we have a unit in the name:
To me Durations are a zero sum gain, because in this case they hide relevant detail (int64 nanoseconds) without enforcing usage. Compare it against what Golang could easily provide -- time.SleepMilli(100), which is 40% less characters for my aging eyes to parse than time.Sleep(100 * time.Millisecond).
After all, in the very same package we have a unit in the name: