Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed C# Objects!
You have completed C# Objects!
Preview
Demystify numbers in code by using constants.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Right now it's obvious why
we're passing one here.
0:00
That's the range we want
the tower to have but
0:00
down here, one is the amount to
decrease the invaders health by.
0:03
It may be obvious now but if we were
to show this code to other programmers,
0:08
it might not be entirely obvious why we
choose to use one both here and here.
0:13
Some might think that I decided to
have the health decreased by one
0:19
because the range is one.
0:23
That wasn't my reasoning but
that isn't very obvious to the reader.
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up