the importance of documentation in programming
DESCRIPTION
COMPUTER PROGRAMMING 6421TRANSCRIPT
![Page 1: The Importance of Documentation in Programming](https://reader033.vdocuments.us/reader033/viewer/2022052504/5549a27db4c905a6758b4f7a/html5/thumbnails/1.jpg)
The Importance of
Documentation in Programming
![Page 2: The Importance of Documentation in Programming](https://reader033.vdocuments.us/reader033/viewer/2022052504/5549a27db4c905a6758b4f7a/html5/thumbnails/2.jpg)
Why is it important?
Without documentat ion, p rograms
may be confusing and / or make no
sense.
![Page 3: The Importance of Documentation in Programming](https://reader033.vdocuments.us/reader033/viewer/2022052504/5549a27db4c905a6758b4f7a/html5/thumbnails/3.jpg)
va r s la ying = t r ue ; va r yo uH i t = M a t h . f lo o r (M a t h . r a nd o m () * 2 ) ; va r d a m a g e T hisR o und = M a t h . f lo o r (M a t h . r a nd o m () * 5 + 1 ) ; va r t o t a lD a m a g e = 0 ; w h i le (s la ying ) { i f ( yo uH i t ) { c o nso le . lo g ("Y o u h i t t he d r a g o n a nd d id " + d a m a g e T hisR o und + " d a m a g e !" ); t o t a lD a m a g e + = d a m a g e T hisR o und ; i f ( t o t a lD a m a g e > = 4 ) { c o nso le . lo g ("Y o u d id i t ! Y o u s le w t he d r a g o n!" ) ; s la ying = f a lse ; } e lse { yo uH i t = M a t h . f lo o r (M a t h . r a nd o m () * 2 ) ; } } e lse { c o nso le . lo g ("T he d r a g o n b ur n ina t e s yo u! Y o u ' r e t o a s t . " ) ; s la ying = f a lse ; }}
?
![Page 4: The Importance of Documentation in Programming](https://reader033.vdocuments.us/reader033/viewer/2022052504/5549a27db4c905a6758b4f7a/html5/thumbnails/4.jpg)
Comment ing
Comments can be their own l ine or
added to t he end of a st r ing.
![Page 5: The Importance of Documentation in Programming](https://reader033.vdocuments.us/reader033/viewer/2022052504/5549a27db4c905a6758b4f7a/html5/thumbnails/5.jpg)
Comment ing Comments can be used as a form of pseudocode to
outline intention prior to writing the actual code. In
this case it should explain the logic behind the code
rather than the code itself.
![Page 6: The Importance of Documentation in Programming](https://reader033.vdocuments.us/reader033/viewer/2022052504/5549a27db4c905a6758b4f7a/html5/thumbnails/6.jpg)
Comment ing in various languages
Javascript / /
Visual Basic
C / * */
‘
![Page 7: The Importance of Documentation in Programming](https://reader033.vdocuments.us/reader033/viewer/2022052504/5549a27db4c905a6758b4f7a/html5/thumbnails/7.jpg)
General Rules for Comment ing
Not every line should be commented, but any line that
performs an operation should.
Any line that causes confusion should be commented.
At the top of the program there should be comments on
its purpose and scope of the program.
Another common comment is a last revised date and
version number at the top of the program.