Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SER516 Lecture 10

SER516 Lecture 10

Software Agility
Technical Skills II
(202102)

B546a9b97d993392e4b22b74b99b91fe?s=128

Javier Gonzalez
PRO

February 14, 2019
Tweet

Transcript

  1. jgs SER 516 Software Agility Lecture 10: Technical Skills II

    Dr. Javier Gonzalez-Sanchez javiergs@asu.edu javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment
  2. jgs 516 00001010 Announcement § Backlog (Product and Spring) including

    stories § Burndown Chart § Product (Source Code) § Retrospective § Review § Due Friday February 19, 11:59 PM AZ time (No extensions)
  3. jgs 516 00001010 Hints http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior

  4. jgs 516 00001010 Hints

  5. jgs 516 00001010 Hints Timer ActionListener JFrame MouseListener Game Cell

    Grid Drawable JPanel Thread
  6. jgs Note

  7. jgs 516 00001010 Note

  8. jgs Previously

  9. jgs 516 00001010 Clean Code Principles 1. Readability e.g., Coding

    guidelines. 2. Simplification and Specification e.g., KISS (Keep It Simple by K. Johnson). 3. Decoupling e.g., LOD (Law of Demeter). 4. Avoid Code Bloat e.g., DRY (Do not Repeat Yourself).
  10. jgs Do your projects have clean code? Simple

  11. jgs 516 00001010 Where are the variables?

  12. jgs 516 00001010 Simplification

  13. jgs 516 00001010 Simplification

  14. jgs 516 00001010 Simplification Where should the name be?

  15. jgs Do your projects have clean code? Avoid Code Bloat

  16. jgs 516 00001010 Bloat

  17. jgs 516 00001010 Bloat

  18. jgs 516 00001010 How many lines in a method? …

    … … 500 LOC in a method… it is to much!
  19. jgs 516 00001010 Methods Create code Elegant and Efficient

  20. jgs 516 00001010 Case 15 !

  21. jgs Recomendations

  22. jgs 516 00001010 Minimum Guidelines § Follow standard conventions https://google.github.io/styleguide/javaguide.html

    § Be consistent. If you do something a certain way, do all similar things in the same way. § Use explanatory variables. § Don't write methods which works correctly depending on something else in the same class. § Keep lines short.
  23. jgs 516 00001010 Minimum Guidelines § Always try to explain

    yourself in code, i.e., avoid comments if possible. § Don't be redundant. § Don't add obvious noise. § Don't comment out code. Just remove. § Use comments as (1)explanation of intent, (2) clarification of code, (3) warning of consequences. § JavaDoc
  24. jgs 516 00001010 Think About It § “The ratio of

    time spent reading vs writing is well over 10:1” § Will you be able to read your classmate code? § Will your classmate be able to read your code?
  25. jgs 516 00001010 References § Java Style Guide https://google.github.io /styleguide/javaguide.html

    http://www.oracle.com /technetwork/java/codeconvtoc-136057.html § Read Chapter 1. Clean code. Robert Martin.
  26. jgs SER 516 Software Agility Javier Gonzalez-Sanchez javiergs@asu.edu Spring 2021

    Disclaimer. These slides can only be used as study material for the class SER516 at ASU. They cannot be distributed or used for another purpose.