4 ms·
To be fair, I am really excited for generics. However I do think the lack of the is the major reason go is such a readable language. Not being able to hide comp
by aaomidi 5y ago
To be fair, I am really excited for generics. However I do think the lack of the is the major reason go is such a readable language. Not being able to hide complexity behind types of types of types really ends up making code easier to follow.
I'm excited and anxious about generics in go.
- lttlrck 5y agoIsn't interface{} similar to void * - the king of hiding types?
- hellcow 5y agoYes, but it's a bit like Rust's `unsafe` in that reaching for it first is not a great practice. There's usually a better way. Using interface{} where you truly don't know and can't predict the data being sent to you is mostly something that libraries (like encoding/json) have already handled, so I don't have to interact with it much directly. I think generics are going to have the biggest impact in adding effortless type safety to all kinds of libraries, though.
- aaomidi 5y agoI really don't come across this in most projects I read and learn from.
- azth 5y agoNot sure golang is readable compared to other more expressive statically typed languages like Java and C#.
- aaomidi 5y agoDefinitely is for me and I used to only use Java for years. You can potentially test this for yourself by opening two large open source projects in each language and trying to figure out an issue from their issue tracker.