Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As a start, Go could separate container and slice types, the way C# did it with T[]/List<T>/other and Span<T>/Memory<T>. No lengthy build process required.


I'm not deeply familiar with those C# types, but I think maybe it already does. An array, which includes the size of itself in its type so that a four-element array is not the same type as an eight-element array, is already in Go. Go's language affordances make it easy to just have slices without the underlying arrays, since they're generally not useful on their own, but you can take arrays and slice into them if you like.


Yeah, but the at the same time, I find C# code a sigil soup. Go makes a different tradeoff.

I've been involved in a few successful large scale projects and never felt like the type system of Go is holding me back too much. Sure the error handling could be better, union type would make interface munging easier, but the current state after generics isn't too bad.


> Sigil soup

Last time I checked, C# had clean and focused syntax for working with collection types. Could you provide an example?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: