2 ms·
> It's a common pattern in lazy construction to check if the receiving pointer is nil before continuing. I disagree: if the construction can fail, the construc
by rakoo 12y ago
> It's a common pattern in lazy construction to check if the receiving pointer is nil before continuing.
I disagree: if the construction can fail, the constructor must return an error, which will be checked; only if the error is nil can the process continue. There shouldn't be logic on the actual data returned to assert whether a constructor worked or not.
- tshadwell 12y agoI meant something like this: http://play.golang.org/p/eqnDLVMHGA http://play.golang.org/p/eqnDLVMHGA (pseudocode)