[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-670914-105":59,"doc-detail-670914-en":134},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":127,"head_meta":129,"extra_data":131,"updated_unix":133},105,"en","clean-code-cheat-sheet-why-clean-code-smells-design-principles-practices","Clean Code Cheat Sheet - Why Clean Code, Smells, Design Principles & Practices","","Clean Code Cheat Sheet outlines why clean code matters for team-wide understandability, readability, changeability, extensibility, and long-term maintainability without accumulating excessive technical debt. It lists common code smells such as rigidity, fragility, immobility, unnecessary complexity, needless repetition, and opacity, explaining how they increase effort and defect risk. It then summarizes core class design principles, packaging cohesion and coupling rules, and general, environment, dependency injection, and design practices for building, testing, and structuring software effectively.",{"@graph":69,"@context":126},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/clean-code-cheat-sheet-why-clean-code-smells-design-principles-practices/670914/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/clean-code-cheat-sheet-why-clean-code-smells-design-principles-practices/670914.png","ImageObject",300,407,{"name":92,"@type":93},"Terk","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-02","2026-11-01",true,{"@type":102,"interactionType":103,"userInteractionCount":8},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118,122],{"name":109,"@type":110,"acceptedAnswer":111},"Why does the document emphasize clean code?","Question",{"text":112,"@type":113},"Clean code is presented as easy for the whole team to understand, which improves readability, changeability, extensibility, and maintainability while reducing technical debt.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What are the main categories of code smells listed?",{"text":117,"@type":113},"The document groups smells such as rigidity, fragility, immobility, viscosity of design/environment, needless complexity, needless repetition, and opacity, each describing how changes become costly or risky.",{"name":119,"@type":110,"acceptedAnswer":120},"Which class design and packaging principles does it cover?",{"text":121,"@type":113},"It covers SRP, OCP, LSP, DIP, ISP, small classes, and separation of responsibilities. For packaging it includes cohesion rules (RREP, CCP, CRP) and coupling rules (ADP, SDP, SAP).",{"name":123,"@type":110,"acceptedAnswer":124},"What engineering practices are recommended beyond design rules?",{"text":125,"@type":113},"Recommendations include standard conventions, KISS, root-cause analysis, using a source control system, continuous integration, single-step build/test, and dependency injection to decouple construction from runtime behavior.","https://schema.org",{"og:url":83,"og:type":128,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":130,"canonical":83},"index,follow",{"doc_id":132,"site_id":62},670914,1793572685,{"code":4,"msg":5,"data":135},{"doc_id":132,"user_id":136,"nickname":92,"user_avatar":137,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":138,"file_id":139,"file_url":140,"file_type":141,"file_size":142,"view_count":8,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":19,"language":143,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":144,"faqs":145,"seo_title":146,"seo_description":67,"update_tm":133,"read_time":52},1099525198933,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","C lean Code Cheat Sheet  \n| \u003Cbr>Why Clean Code\u003Cbr>Code is clean if it can be understood easily – by everyone on the team. With understandability comes readability, changeability, extensibility and maintainability. All the things needed to keep a project going over a longtime without accumulating up a large amount of technical debt. |  |  | \u003Cbr>Smells\u003Cbr>Rigidity –\u003Cbr>The software is difficult to change. A small change causes a cascade of subsequent changes.\u003Cbr> Fragility – \u003Cbr>The software breaks in many places due to a single change.\u003Cbr> Immobility – \u003Cbr>You cannot reuse parts of the code in other projects because of involved risks and high effort.\u003Cbr> Viscosity of Design – \u003Cbr>Taking a shortcut and introducing technical debt requires less effort than doing it right.\u003Cbr> Viscosity of Environment – \u003Cbr>Building, testing and other tasks take a long time. Therefore, these activities are not executed properly by everyone and technical debt is introduced.\u003Cbr> Needless Complexity – \u003Cbr>The design contains elements that are currently not useful. The added complexity makes the code harder to comprehend. Therefore, extending and changing the code results in higher effort than necessary.\u003Cbr> Needless Repetition – \u003Cbr>Code contains exact code duplications or design duplicates (doing the same thing in a different way) . Making a change to a duplicated piece of code is more expensive and more error-prone because the change has to be made in several places with the risk that one place is not changed accordingly.\u003Cbr> Opacity – \u003Cbr>The code is hard to understand. Therefore, any change takes additional time to first reengineer the code and is more likely to result in defects due to not understanding the side effects.\u003Cbr>\u003Cbr>Class Design\u003Cbr>Single Responsibility Principle (SRP) +\u003Cbr>A class should have one, and only one, reason to change.\u003Cbr> Open Closed Principle (OCP) + \u003Cbr>You should be able to extend a classes behaviour without modifying it.\u003Cbr> Liskov Substitution Principle (LSP) + \u003Cbr>Derived classes must be substitutable for their base classes.\u003Cbr> Dependency Inversion Principle (DIP) + \u003Cbr>Depend on abstractions, not on concretions.\u003Cbr> Interface Segregation Principle (ISP) + \u003Cbr>Make fine grained interfaces that are client-specific.\u003Cbr> Classes Should be Small + \u003Cbr>Smaller classes are easier to grasp. Classes should be smaller than about\u003Cbr>100 lines of code. Otherwise, it is hard to spot how the class does its job and it probably does more than a single job.\u003Cbr>\u003Cbr>Do stuff or know others, but not both\u003Cbr>Classes should either do stuff (algorithm, read data, write data,…) or orchestrate other classes. This reduces coupling and simplifies testing.\u003Cbr>\u003Cbr>Package Cohesion\u003Cbr>Release Reuse Equivalency Principle (RREP) +\u003Cbr>The granule of reuse is the granule of release.\u003Cbr> Common Closure Principle (CCP) + \u003Cbr>Classes that change together are packaged together.\u003Cbr> Common Reuse Principle (CRP) + \u003Cbr>Classes that are used together are packaged together.\u003Cbr>\u003Cbr>Package Coupling\u003Cbr>Acyclic Dependencies Principle (ADP) +\u003Cbr>The dependency graph of packages must have no cycles.\u003Cbr> Stable Dependencies Principle (SDP) + \u003Cbr>Depend in the direction of stability. |  Stable Abstractions Principle (SAP) + \u003Cbr>Abstractness increases with stability\u003Cbr>\u003Cbr>General\u003Cbr>Follow Standard Conventions +\u003Cbr>Coding-, architecture-, design guidelines (check them with tools)\u003Cbr> Keep it Simple, Stupid (KISS) + \u003Cbr>Simpler is always better. Reduce complexity as much as possible.\u003Cbr> Boy Scout Rule + \u003Cbr>Leave the campground cleaner than you found it.\u003Cbr> Root Cause Analysis + \u003Cbr>Always look for the root cause of a problem. Otherwise, it will get you again.\u003Cbr> Multiple Languages in One Source File – \u003Cbr>C\\#, Java, JavaScript, XML, HTML, XAML, English, German …\u003Cbr>\u003Cbr>Environment\u003Cbr>Project Build Requires Only One Step +\u003Cbr>Check out and then build with a single command.\u003Cbr> Executing Tests Requires Only One Step + \u003Cbr>Run all unit tests with a single command.","cbCaiv52fc4Znahl","https://ap.wps.com/l/cbCaiv52fc4Znahl","pdf",602710,"English","# Why Clean Code\n# Smells\n# Class Design Principles\n# Package Cohesion\n# Package Coupling\n# General Rules\n# Environment Practices\n# Dependency Injection\n# Design Guidelines","[{\"question\":\"Why does the document emphasize clean code?\",\"answer\":\"Clean code is presented as easy for the whole team to understand, which improves readability, changeability, extensibility, and maintainability while reducing technical debt.\"},{\"question\":\"What are the main categories of code smells listed?\",\"answer\":\"The document groups smells such as rigidity, fragility, immobility, viscosity of design/environment, needless complexity, needless repetition, and opacity, each describing how changes become costly or risky.\"},{\"question\":\"Which class design and packaging principles does it cover?\",\"answer\":\"It covers SRP, OCP, LSP, DIP, ISP, small classes, and separation of responsibilities. For packaging it includes cohesion rules (RREP, CCP, CRP) and coupling rules (ADP, SDP, SAP).\"},{\"question\":\"What engineering practices are recommended beyond design rules?\",\"answer\":\"Recommendations include standard conventions, KISS, root-cause analysis, using a source control system, continuous integration, single-step build/test, and dependency injection to decouple construction from runtime behavior.\"}]","Clean Code Cheat Sheet - Why Clean Code, Smells, Design Principles & Practices | PDF"]