|
|
|
|
|
by sacado2
2211 days ago
|
|
> Maybe I’m doing something wrong, but my Go code is often littered with casts between different integer sizes and signedness. It can actually be a feature, and one of the things that brought me to go, as you can define your own integer (or float, or string, etc.) types, thus making them incompatible with each other: type distance int
type speed int
func distFor(d distance, t time.Time) speed { ... }
...
x = distFor(x, t) // Oops, that's probably a bug!
Not many languages let you do this, especially back then. But yeah, not great for exploratory programming. |
|