|
|
|
|
|
by zimbatm
4367 days ago
|
|
If you truly care about speed you'll have different optimizations for int32 and int64. Depending on who you are working with, the lack of generics is a blessing. Some developers can't restrain themselves and create over-complex abstractions that are used only once. |
|
Picture this function:
What does it do?As you can see this function takes 2 arguments, which appears to be functions. It also returns a function. The argument and return type of these functions are unknown, so you can't manipulate them. You can just pass them around directly. This puts really tight constraints on your code. So, assuming nothing fancy happens, there is only one correct body of code for this type signature:
In other words, function composition.---
Generic functions have more guarantees than non-generic functions. Therefore, you are more likely to know what a generic function is actually doing.