Lecture 3 - Coding Style.pptx - Coding Style By Christopher Mar Grading Rubrics Comments • Much of what makes a comment useful is personal preference

Lecture 3 - Coding Style.pptx - Coding Style By Christopher...

This preview shows page 1 - 15 out of 15 pages.

Coding Style By Christopher Mar
Image of page 1
Grading Rubrics
Image of page 2
Comments Much of what makes a comment useful is personal preference For that reason, comments in programming assignments will not be graded
Image of page 3
My Comment Preferences Comments for a single line aren’t particularly useful unless it is a definition Useful: li $t0, 0xf0a00000 # LED Address Not so useful: addiu $t1, $t1, 1 # $t1 = $t1 + 1
Image of page 4
My Comment Preferences I like to place a comment before any subroutine or functional block of code: Describing its purpose/function Register usage (if relevant)
Image of page 5
My Comment Preferences Your code can be self-documenting if it uses meaningful label names Good label name as useful as a comment for understanding what is being jumped/branched to Project 2 example label: LED_pattern_odd:
Image of page 6
Comments: Bottom Line Write comments so that when you revisit your program (be it 2 days or 2 years) they
Image of page 7
Image of page 8
Image of page 9
Image of page 10
Image of page 11
Image of page 12
Image of page 13
Image of page 14
Image of page 15

You've reached the end of your free preview.

Want to read all 15 pages?

  • Spring '08
  • Calliss

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors