JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Intro to JS+prossecingJS
Intro to JS+prossecingJS
More
Share
Explore
Session 6
Writing Clean Code
Writing Clean Code
Comments
A comment is where human can read in code, you can use comment to represent what does a line of code do.
Do make a comment, you just need to type two slashes
//
and then boom! Your done. You can type any text in that line.
Readable Code
Here, we have a line of code below:
It looks messy, so let’s see how we can make it more readable. To do that, let’s give each statement it’s own line:
It looks cleaner, but we can make it more cleaner by indenting and giving white space to punctuation and letters:
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.