So, folks who build web sites, I just added this conditional syntax to Kitten HTML template strings. Thoughts?

(See third code example. The is().yes().no().endIs() function chaining. My goal is to provide an alternative to the JavaScript ternary operator that’s easier to read. Does this succeed? Any suggestions?)

codeberg.org/kitten/app#how-ma…

#interfaces #code #design

in reply to Aral Balkan

initial reaction:
i don't like the .endIf - feels really awkward.

yes & no feel wrong because it's not a yes/no question it's a true/false question. it's introducing new terminology that isn't clearer than old. if sticking with that, then what about

isTrue().yes().no()
or
test().trueResult().falseResult()

Also, if thinking about how to better it, I can't help but think about simplicity of the lisp/scheme version (test true-result false-result)