I was recently working on an Ember app with some people who are new to the framework. We created a Google Map component, and while reviewing the code I came across this:

At first glance, it wasn’t too bad. Sure, in their template and everywhere in the code they used `currentLocations`, but it worked. Then, an Ember buddha whispered quietly to me “property setter.” After a quick refactor, the code looked like this:

At first glance, it’s obvious that the new code is longer. However, it removes the need to keep the separation of locations and currentLocations, which was already the source of one bug. It also reads a little more clearly since you aren’t relying on an observer but a setter function with the property name. The syntax of Ember’s setters takes a little while to get used to, but while not perfect, can have a positive impact on the code.