提供互引机会:锂电池,电动车,ME,EE方向# Chemistry - 化学
p*2
1 楼
Copy and Paste
A combination of interfaces and good ol’ copy and paste is the way Go
currently implements sortable slices. This is of course a terrible, terrible
idea. The names of your types will end up being StringSet, IntSet, and
FloatSet. When you find a bug you’ll be forced to go through all of the
instances where you copied and pasted, fix it and hope you don’t miss any.
This is clearly not a sustainable way to ‘implement’ generics.
A combination of interfaces and good ol’ copy and paste is the way Go
currently implements sortable slices. This is of course a terrible, terrible
idea. The names of your types will end up being StringSet, IntSet, and
FloatSet. When you find a bug you’ll be forced to go through all of the
instances where you copied and pasted, fix it and hope you don’t miss any.
This is clearly not a sustainable way to ‘implement’ generics.