Areas for Code Improvement

Areas for Code Improvement
Slide Note
Embed
Share

Identify and Improve Code Areas. Review examples of poorly written code and learn how to enhance readability and efficiency. Address issues with Javadoc comments and method structure.

  • Code Improvement
  • Javadoc
  • Method Structure
  • Readability
  • Efficiency

Uploaded on Feb 20, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010. They may not show up well on other PowerPoint versions. You can download PowerPoint 2010 viewer from here. These slides contain a lot of animations. For optimal results, watch in slideshow mode.

  2. Identify areas to improve in the code below

  3. Higher level Same level

  4. How not to do Ice Bucket Challenge

  5. /** * Executes the given command. * @return the Result of the execution. */ Result execute(Command command) { Method makes sense on its own /** * Used for formatting text in UI. */ Refers to usage Parameter doesn t make sense void execute(String delimiter) { /** * @return list of persons. */ List<String[]> execute(Command command) { Return value doesn t make sense

  6. Javadoc comments 8

  7. /** * This method runs ... */

  8. 11

  9. Good code looks neat.

  10. Is this the best I can When to stop? do/be?

  11. Code gorilla Code monkey

  12. Master craftsman Code gorilla Code monkey

  13. Master craftsman

  14. Image credit: www.crafthubs.com

  15. Learn smarter! (learn like a cat, not like a mouse)

  16. Learn smarter! (learn like a cat, not like a mouse)

  17. High diversity! CS2103

  18. High diversity! text books HEAVY

  19. How?

  20. How?

  21. How?

  22. How?

  23. How? How

  24. How? What? Why? How

  25. How? What? Why? How

  26. How? What? Why? How

  27. How?

  28. How?

  29. Read smarter

  30. Where we are Can refactor code to improve quality. Can abstract methods well. Can use basic revision control. Can create pull requests. Lecture 3 Theme: Towards higher level abstractions.

Related


More Related Content