4 ms·
1. Naming conventions don’t solve syntax warts. Modern languages solve this as part of their null safety (eg optional monads or the ? on kotlin and swift) 2. Y
by herval 8y ago
1. Naming conventions don’t solve syntax warts. Modern languages solve this as part of their null safety (eg optional monads or the ? on kotlin and swift)
2. Yes, I know how to “properly” do it. Does not eliminate human error.
3. Closures in any other language, afaik. I rarely code in Js, fyi
- gant 8y agoRegarding 1, I (and seemingly everyone else writing libraries) usually return (value, error) and treat a nil value as error. We have quite a bit of old code at work that might segfault because it wasn't done like this. Most of our Kubernetes code looks something like this _, err := clientInterface.Update(object) if err != nil { if machinery_errors.IsNotFound(err) { //handle nil case } else // handle unexpected case } }