4 ms·
There's a difference between using a struct to represent concepts like program configuration or grouped function parameters, and shoehorning OO-native design co
by solatic 6y ago
There's a difference between using a struct to represent concepts like program configuration or grouped function parameters, and shoehorning OO-native design concepts like the decorator pattern that need inheritance into a language that doesn't support dynamic dispatch. Much of the bad Go code I see comes, yes, from overusing abstractions and lots of copy-pasting, but most of that comes from trying to fit square pegs like OO design into Go's round hole.
- cy_hauser 6y agoStill don't get the connection in the way you do. Maybe I'm so used to OO stuff that I just gloss over it. > a language that doesn't support dynamic dispatch. Go's interfaces do support this enough that I consider it worth at least mentioning. https://en.wikipedia.org/wiki/Dynamic_dispatch#Go_and_Rust_implementation https://en.wikipedia.org/wiki/Dynamic_dispatch#Go_and_Rust_i...