# 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: