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! While you're at it, check out some resources Treehouse students have shared here.
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
Marcy Kronrad
95 PointsAre comments in the code considered syntax?
You know how you can make comments in the code like
//Best work ever
Is that considered Syntax?
2 Answers
Micahyah Hawkins
3,496 Points"Syntax" of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document or fragment in that language.
So, to have a comment you must use the correct programming "Syntax" for your programming language.
In this case for swift and iOS programming the syntax of a comment is preceded with // This is the programming language's syntax to identify a comment.
A comment itself isn't syntax. How you have to enter a comment for the IDE to recognize it as a comment is the Syntax.
Hope this helps and I know I just repeated myself but tried to word it various ways to hope you understand what I was trying to explain.
Gloria Dwomoh
13,116 PointsI am not sure what you mean by syntax, but yes that is a commenting syntax. Depending on if you are doing swift or objective C there might be more ways to comment.
Marcy Kronrad
95 PointsWhat do you mean by your not sure what I mean by syntax?
Gloria Dwomoh
13,116 PointsIf you are asking if it is part of the coding syntax or it is considered a syntax error. I am not sure if I understood the right thing, according to your question, but I replied to it being a form of coding syntax.
Marcy Kronrad
95 PointsMarcy Kronrad
95 PointsThank you so much