The Importance of Documentation in Programming

  • 319 views
Uploaded on

COMPUTER PROGRAMMING 6421

COMPUTER PROGRAMMING 6421

More in: Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
319
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. The Importance of Documentation in Programming
  • 2. Why is it important? Without documentation, programs may be confusing and/or make no sense.
  • 3. va r sla ying = t rue ; va r youH it = M a t h.f loor (M a t h.ra ndom () * 2); va r da m a ge ThisRound = M a t h.floor (M a t h.ra ndom () * 5 + 1); va r t ot a lD a m a ge = 0; w hile (sla ying) { if (youH it ) { c onsole .log("You hit t he dra gon a nd did " + da m a ge ThisRound + " da m a ge !"); t ot a lD a m a ge + = da m a ge ThisRound ; if (t ot a lD a m a ge > = 4) { c onsole .log("You did it ! You sle w t he dra gon!"); sla ying = f a lse ; } e lse { youH it = M a t h.f loor (M a t h.ra ndom () * 2); } } e lse { c onsole .log("The dra gon burnina t e s you! You' re t oa st ."); sla ying = fa lse ; }} ?
  • 4. Commenting Comments can be their own line or added to the end of a string.
  • 5. Commenting 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.
  • 6. Commenting in various languages Javascript / / Visual Basic C / * */ ‘
  • 7. General Rules for Commenting 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.