# Programming patterns, design patterns, principles, best practices, & code quality ## Overview ### Gist wiki:: [Coding best practices - Wikipedia](https://en.wikipedia.org/wiki/Coding_best_practices) ## [[Design Pattern]] ## [[Anti-pattern]] ## [[Architectural Pattern]]s ## [[Best Practice]] ## [[The Zen of Python]] ## [[DRY (Don’t Repeat Yourself)]] ## [[KISS Principle]] ## [[Magic Number]] ## [[Magic String]] ## Only use a variable when you need to refer to it later ### e.g., Not x = 100, print(x). Just print(100) ## [[Iterative and incremental development]] ## Bob Martin ## SOLID ### Open-closed Principle - https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle ### Dependency inversion principle (DIP) - https://en.wikipedia.org/wiki/Dependency_inversion_principle ### Single Responsibility Principle - omnioutliner:///open?row=hlX2nT4AVSQ ### Liskov substitution principle - https://en.wikipedia.org/wiki/Liskov_substitution_principle ### https://en.wikipedia.org/wiki/SOLID ### Interface segregation principle - https://en.wikipedia.org/wiki/Interface_segregation_principle ## [[GRASP (Object-oriented Design)]] ## [[Loose Coupling]] ## [[Cohesion]] ## [[Separation of Concerns]] ## [[Separation of Content and Presentation]] ## [[Modular Programming]] ## [[Conway's Law]] ## [The Three Virtues of a GREAT Programmer](http://threevirtues.com/) ## [[Component-based Software Engineering]] ## [[Information Hiding]] ## [[Reusability]] ## [[Package Principles]] ## [[Minimalism (computing)]] ## [[Software Bloat]] ## [[Technical Debt]] ## [[Worse is Better]] ## [[Unix Philosophy]] ## [[The Zen of Python]] ## The Mythical Man-Month ### https://en.wikipedia.org/wiki/The_Mythical_Man-Month ### Brooks' Law - https://en.wikipedia.org/wiki/Brooks%27s_law ## [[Composability]] ## [[Pareto Principle]] ## [[Principle of Least Privilege]] ## [[There's more than one way to do it (TMTOWTDI or TIMTOWTDI, pronounced Tim Toady)]] ## The Cathedral and the Bazaar ### https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar ## [[Twelve-Factor App methodology]] ## [[LeBlanc's Law]] ## [[Lehman's Laws of Software Evolution]] ## [[You Aren't Gonna Need It (YAGNI)]] ## [[Testing Best Practices]] ## Tools - [[SonarQube]] - [[ESLint]] - [[JSHint]] - [[Klockwork]] - [[Code Climate]] - [[Codacy]] - [[DeepScan]] - [[Embold]] ## Inbox - you can check whether one number is divisible by another—if x % y is zero, then x is divisible by y. This can be used, in particular, to determine whether an integer is even or odd. If x % 2 is zero, then x is even. If x % 2 is 1, then x is odd. - You can also use % to extract the right-most digit or digits from a number. For example, x % 10 yields the right-most digit of x (in base 10). Similarly x % 100 yields the last two digits. - [[Dogfooding]] - [[Peter Principle]] - [[Goodhart's Law]]