3 ms·
Been using Go for 4 years. I totally agree. It sucks to have to use your brain to think about alternative ideas on how to do something. However, I’ve come acr
by tebruno99 8y ago
Been using Go for 4 years. I totally agree. It sucks to have to use your brain to think about alternative ideas on how to do something. However, I’ve come across much much better solutions to my problems than I would have if Go offered a crutch to my flawed thinking.
- aikah 8y agoThe problem is the solution is often to make the compiler ignore types all together and use interface {} wholesale, then test interfaces with type assertions. If Go had a least unions, it would be a bit less painful to describe a range of finite types while keeping things strictly typed in functions and methods. Unions are a limited form of type polymorphism in a garbage collected language.
- weberc2 8y agoI'd be disappointed if Go went for unions instead of full-on Rust-like enums, but I agree with your general point.
- yawaramin 8y ago> I’ve come across much much better solutions to my problems than I would have if Go offered a crutch to my flawed thinking. Any example where you have a better solution than using generics?