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
This syntactic sugar removes the braces from simple methods and properties and makes them one-liners.
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
On the other hand,
C# contains a lot of syntactic sugar.
0:00
Syntactic sugar is a feature
in a programming language
0:00
that helps with writing more concise code.
0:03
They provide alternative ways to write
the same code using fewer keystrokes.
0:06
We recently saw one example of syntactic
sugar, the ternary if statement.
0:11
So instead of typing this,
we only need to type this.
0:16
Another example is auto-properties,
0:21
where instead of typing this
we only need to type this.
0:24
The result of using syntactic sugar in
general is shorter more concise code.
0:29
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