|
|
|
|
|
by flakes
120 days ago
|
|
I'd say a lot of users are going to borrow patterns from Go, where you'd typically check the error first. resource, err := newResource()
if err != nil {
return err
}
defer resource.Close()
IMO this pattern makes more sense, as calling exit behavior in most cases won't make sense unless you have acquired the resource in the first place.free may accept a NULL pointer, but it also doesn't need to be called with one either. |
|