4 ms·
I would really love to see default parameters and struct values. I jump between Python and Go in my day job and Go is a much better language overall but things
by mountainriver 5y ago
I would really love to see default parameters and struct values. I jump between Python and Go in my day job and Go is a much better language overall but things like this make it painful
- geenat 5y agoThis is also my #1. Parameter / Option ergonomics. The current best practice of "functional options" and long function chains results in far too many function stubs ... its a minimum of 3 extra lines per parameter. Parameter structs require a whole extra struct... Borrowing optional / named parameters from Python would cut down length and complexity of Go code drastically.
- Jeff_Brown 5y agoDefault parameters have always struck me as dangerous. (And for my day job I use Python.)
- mountainriver 5y agoI always hear this argument but I’ve never seen it be dangerous in my day to day. We deal with defaults all the time in programming and it’s generally fine