if (this.finished) { ...
or <div v-if="showMainContent>...
With your convention, these could easily be functions, but they are never evaluated without parens. Nor is any error thrown. Instead, the fact that the function exists is truthy and you get the true case always.In our teams's js code we even include "get" for "is" properties (getIsEnabled() rather than isEnabled()) so that it's perfectly obvious if you're ever using a function without calling it.
function f() {}
if (f) {}
produces: This condition will always return true since this function is always defined. Did you mean to call it instead?(2774)
https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABMA...if (getBooleanProperty) { ... }
omitting the parens.
In which case I still see it as just a personal preference. The prefix of "is" becomes reassurance that something is intended to have a boolean value, which may be more important.
Of course it goes without saying that both of these things are (usually) addressed by a system like Typescript.
Some people feel that symmetry in names is important when achievable, since it makes them more predictable and the entire API more easy to figure out.
That's valid and maybe I'll update the guide to explain a bit more when/where I have found getProperty() useful:
I often do it when I end up having to have parity in API request: a get AND a set. If there's more than one thing i'm doing with temperature, it's helpful to show WHAT I'm doing with it, specifically. I'll noodle on your thoughts a bit and see how I can incorporate them.