Task Summary
What you will learn
You will learn how to comment code and why code has comments.
How will you be assessed
You will need to comment the code you have written so far. If you do not have your code the the teacher will provide you with a template to comment..
You will learn how to comment code and why code has comments.
How will you be assessed
You will need to comment the code you have written so far. If you do not have your code the the teacher will provide you with a template to comment..
Activities
- A brief look into commenting code
1. A brief look into commenting code
The term Commenting code means to annotate (describe) each line of code to note in plain English (or other language) to explain what the code does.
By doing this it makes it easy for a programmer to go back to the code and make changes or correct bugs.
An example of code which is already commented is shown below, you can see the the <!-- Your comment goes here --> are used at the start of each line of comment. The <!-- --> tells the software that is reading the code (The web browser) to ignore and text in the comment because it it just there to help the programmer. If you are using Notepad ++ your comments should show in green and the rest of your coding should remain blue, red and black.
You will get 1 mark for each line of correct code and 1 mark for each correct comment. Look to comment about 10 lines of code and remember to put <!-- before your comment and --> after your comment.
You can use the internet to search for help, but this is a test so no talking to your friends.
Place a screenshot of your commented code in the document sent to you via Dash (can also be found below on this page)
Place a screenshot of your website as it is seen in your browser in the same document. Remember to screenshot press" prtscr"on your keyboard then paste into the MS word document. Paste - crtl V or right click and paste.
Below is an example of a screenshot from a website and a screenshot of code that has 1 correct comment on it.
The term Commenting code means to annotate (describe) each line of code to note in plain English (or other language) to explain what the code does.
By doing this it makes it easy for a programmer to go back to the code and make changes or correct bugs.
An example of code which is already commented is shown below, you can see the the <!-- Your comment goes here --> are used at the start of each line of comment. The <!-- --> tells the software that is reading the code (The web browser) to ignore and text in the comment because it it just there to help the programmer. If you are using Notepad ++ your comments should show in green and the rest of your coding should remain blue, red and black.
You will get 1 mark for each line of correct code and 1 mark for each correct comment. Look to comment about 10 lines of code and remember to put <!-- before your comment and --> after your comment.
You can use the internet to search for help, but this is a test so no talking to your friends.
Place a screenshot of your commented code in the document sent to you via Dash (can also be found below on this page)
Place a screenshot of your website as it is seen in your browser in the same document. Remember to screenshot press" prtscr"on your keyboard then paste into the MS word document. Paste - crtl V or right click and paste.
Below is an example of a screenshot from a website and a screenshot of code that has 1 correct comment on it.
Key Terminology
- User-Friendly
- Comment code
- SEO - Search Engine Optimisation
- HTML - Hyper Text Markup Language
- CSS - Cascading Style Sheets
- Corporate Design
- Hyperlinks
Assessment Task 3
Task: This will be your End of Term assessment task. In controlled assessment conditions you will need to demonstrate that you understand what each line of code you have written does be adding a appropriate comments to the code. Use the method <!-- --> as shown in the activity above. If you have lost your code or your code is incomplete then you will be provided with a template for this task.
commenting_code_task_3.docx | |
File Size: | 1014 kb |
File Type: | docx |