Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Should the getter for the setter be before the setter or after?
Just out of curiosity. In the tutorial it showed the writing of the setter first, and then the getter for that setter was added in and placed BEFORE the setter.
My question is, does it matter if the getter that returns the backing property of the setter is written before or after its corresponding setter?
It shouldn't matter when it comes to functionality, but it's good practice to put
setter for better readability.