4 ms·
You can define methods on structs which is not unlike classes. You can define an interface with methods that allow objects to be processed in a more generic fa
by imetatroll 8y ago
You can define methods on structs which is not unlike classes.
You can define an interface with methods that allow objects to be processed in a more generic fashion.
I think that more than anything it would require a change of mindset that people understandably don't want to deal with.
- alexkavon 8y agoThere's also always a package to handle that issue. [0][1][2] As well as other options. [3] I like to imagine that the "no generics, no way" crowd would never use the stairway in their building if the elevator broke down. [0] https://github.com/clipperhouse/gen https://github.com/clipperhouse/gen [1] https://github.com/cheekybits/genny https://github.com/cheekybits/genny [2] https://github.com/cosmos72/gomacro https://github.com/cosmos72/gomacro [3] https://appliedgo.net/generics/ https://appliedgo.net/generics/
- pjmlp 8y agoAh, but the generics building was conceived with an elevator to start with, and it will eventually be repaired. Go's building architects decided an elevator was superfluous, as everyone should walk 20 stores high every single day, it is good for their health.
- alexkavon 8y agoMore like Go’s building comes building-agnostic, whether you have 20 stories or not. Anything you need (such as a generic elevator) can be added on. No need to walk 20 stories every day because you can just add what you need in through reusable packages.
- pjmlp 8y agoActually no, because in the end it will look like an Escher building.
- zaphirplane 8y agoWell yes I wouldn’t move into a building without an elevator if I felt I needed an elevator at that height
- newalexandria 8y agoMaybe language communities are formed from people that need or don't-need those kind of affordances. e.g. Imagine the office environment you'd have if all your cohort were people that walked 20 flights without making it an issue.