# conditionals

Conditionals are programming-language control-flow constructs that choose and execute different code paths based on whether tests or predicates evaluate as true or false, including forms such as if, cond, and case.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Computed Property Macros

DevFeed: [Computed Property Macros](<https://devfeed.tech/articles/computed-property-macros-40621.md>)

Original publisher: [Read original article](<https://eviltrout.com/blog/2013-07-07-computed-property-macros/>)

Published: 2013-07-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Robin Ward](<https://devfeed.tech/sources/robin-ward.md>)

Topics: [Ember](<https://devfeed.tech/topics/ember.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Handlebars](<https://devfeed.tech/topics/handlebars.md>), [conditionals](<https://devfeed.tech/topics/conditionals.md>), [functions](<https://devfeed.tech/topics/functions.md>)

Tags: [caching](<https://devfeed.tech/tags/caching.md>), [conditionals](<https://devfeed.tech/tags/conditionals.md>), [ember](<https://devfeed.tech/tags/ember.md>), [functions](<https://devfeed.tech/tags/functions.md>), [templates](<https://devfeed.tech/tags/templates.md>)

### AI overview

This tutorial explains how Ember computed property macros can simplify computed properties in applications using Handlebars templates. It describes their use as shorter, clearer alternatives for common computed-property patterns and notes that they can reduce repeated property names while supporting cached intermediate results.

### Source excerpt

Computed Properties By design, Handlebars templates don't allow complex expressions. You are given an {{#if}} block helper, but it can only evaluate whether something is "truthy" (aka true, a non-empty string or array or other value that is not undefined or null.) For example, you can't do something like this: {{#if (eyes.length == 1) && (horns.length == 1) && flies && (color == 'purple') && eatsDudes}} <i>It was a one-eyed, one-horned, flying purple people eater!</i> {{/if}} Handlebars encourages you to use a single evaluation for your logic: