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 trialjubinkurien
359 PointsWhat is White Space characters in Swift /Programming ?
I don't understand what is white space character in Swift /Programming ? Does this rule only apply when declaring variables and constants. Or does this also apply when writing statements ? I seem to be confusing this with inputting spacebar before declaration.
2 Answers
Kirby Ziada
9,886 PointsProgramming languages often don't read spaces.
Hence why; var programmingLanguage="Swift" is also the same as; var programmingLanuage = "Swift"
Or you could have 8 different spaces if you'd like... doesn't matter but it's about being readable for you or anyone else working on the app.
Cahue Beltrao
Courses Plus Student 902 PointsIn your code, it's mostly for readability and is ignored when being interpreted by a machine, but some programming languages do use whitespaces in some occasions. Also whitespace is not ignored when contained within a variable of type string, then it's a character just like any other.
Kenan Bateman
16,715 PointsKenan Bateman
16,715 PointsWhite space is another word for a spacebar. It's not directly linked to how you use it, just any space is considered "white space"