`IfBlank` should allow three arguments (the third would be `if not blank do this`)

Yeah, another way to say this is that

var.IfBlank(false)

is the same as

If(var.IsBlank(), false, var)

Right, a better way to solve this problem would be to have early terminating error checking . I.e. this formula should not throw an error:

If(
  variable.isBlank(),
  false,
  variable.attributeThatOnlyExistsWhenVariableIsNotBlank
)

However, it does currently throw an error.

Frankly, I’m not a fan of error catching nor exception handling. In object oriented languages I think it’s fine, but Coda is quite functional, so I think it’s better to stick with good old fashioned writing code that works and testing edge cases.

Edit: Let me clarify this. I really appreciate the errors the formula typechecking system gives me. That’s not what I’m trying to avoid. What I don’t want to have to do is Python style try...except blocks, nor IfError('ErrorType', ...)type code. I have found (for me at least) it leads to lazy and occasionally error prone code.


Made a new suggestion based on this conversation:

2 Likes