5 ms·
> Integers and strings; those things aren’t nilable. Which is then annoying because if you want an optional integer you now need a pointer, and a heap allocati
by masklinn 4y ago
> Integers and strings; those things aren’t nilable.
Which is then annoying because if you want an optional integer you now need a pointer, and a heap allocation.
- convolvatron 4y agodoes anyone else think Go would be a much better language without the pointer distinction? maybe an explicit mutable type modifier instead?
- ok_dad 4y agoYea, I think references to other values should be a type, like a `Reference[T]`. Then you can pass something by reference, rather than value, without having confusing referencing/dereferencing. A `Reference[T]` could have some sort of element reflection, where you can just use it like it's a `T`. Pointers, referencing, dereferencing; that can get confusing even for skilled engineers.
- ok_dad 4y agoThat's one of the most annoying things to me coming from Python: the inability to have a default argument value.
- ecnahc515 4y agoGo can use escape analysis to determine if a heap allocation is actually required in some cases.