├── GregYoung_8LinesOfCode.pdf ├── README.md ├── kent_beck_simple_design.jpg └── principles_and_patterns.pdf /GregYoung_8LinesOfCode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkisiele/awesome-clean-code/a93af686e76e8aeee4c03a3ab18d70df30fc92d8/GregYoung_8LinesOfCode.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Awesome Clean Code [![Awesome](https://awesome.re/badge.svg)](https://awesome.re) 2 | ## Design Principles 3 | ### [SOLID](http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod) 4 | Acronym coined by Robert C. Martin (Uncle Bob) to descibe the following five principles: 5 | 1. [The Single Responsibility Principle](https://docs.google.com/open?id=0ByOwmqah_nuGNHEtcU5OekdDMkk) A class should have only one reason to change. 6 | 2. [The Open Closed Principle](http://docs.google.com/a/cleancoder.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BwhCYaYDn8EgN2M5MTkwM2EtNWFkZC00ZTI3LWFjZTUtNTFhZGZiYmUzODc1&hl=en) Software entities should be open for extension, but closed for modification. 7 | 3. [The Liskov Substitution Principle](https://drive.google.com/file/d/0BwhCYaYDn8EgNzAzZjA5ZmItNjU3NS00MzQ5LTkwYjMtMDJhNDU5ZTM0MTlh/view) Derived classes must be substitutable for their base classes. 8 | 4. [The Interface Segregation Principle](https://drive.google.com/file/d/0BwhCYaYDn8EgOTViYjJhYzMtMzYxMC00MzFjLWJjMzYtOGJiMDc5N2JkYmJi/view) Make fine grained interfaces that are client specific. 9 | 5. [The Dependency Inversion Principle](https://drive.google.com/file/d/0BwhCYaYDn8EgMjdlMWIzNGUtZTQ0NC00ZjQ5LTkwYzQtZjRhMDRlNTQ3ZGMz/view) Depend on abstractions, not on concretions. 10 | 11 | A local copy of ["Design Principles and Design Patterns"](https://github.com/kkisiele/awesome-clean-code/raw/master/principles_and_patterns.pdf) by Robert C. Marin from _objectmentor.com_ website. 12 | More about this principles with examples can be found [here](https://lostechies.com/wp-content/uploads/2011/03/pablos_solid_ebook.pdf) 13 | 14 | ### [Kent Beck's Four Rules of Simple Design](https://martinfowler.com/bliki/BeckDesignRules.html) 15 | ![Kent Beck's Four Rules of Simple Design](https://github.com/kkisiele/awesome-clean-code/raw/master/kent_beck_simple_design.jpg "Kent Beck's Four Rules of Simple Design") 16 | 17 | A design which: 18 | 1. Passes all tests. 19 | 2. Reveals intention. 20 | 3. No duplication. 21 | 4. Fewest elements. 22 | 23 | ### [Elegant Objects](http://www.elegantobjects.org) 24 | 1. No null. 25 | 2. No code in constructors. 26 | 3. No getters and setters. 27 | 4. No mutable objects. 28 | 5. No static methods, not even private ones. 29 | 6. No instanceof, type casting, or reflection. 30 | 7. No public methods without @Override. 31 | 8. No statements in test methods except assertThat. 32 | 9. No implementation inheritance. 33 | 34 | ### [CUPID](https://dannorth.net/2022/02/10/cupid-for-joyful-coding/) 35 | 1. Composable: plays well with others 36 | 2. Unix philosophy: does one thing well 37 | 3. Predictable: does what you expect 38 | 4. Idiomatic: feels natural 39 | 5. Domain-based: the solution domain models the problem domain in language and structure 40 | 41 | ## Featured Articles 42 | * [When A Method Can Do Nothing](https://michaelfeathers.silvrback.com/when-it-s-okay-for-a-method-to-do-nothing) 43 | * [Tell Don't Ask](https://martinfowler.com/bliki/TellDontAsk.html) 44 | * [Converting Queries to Commands](https://michaelfeathers.silvrback.com/converting-queries-to-commands) 45 | * [Object Calisthenics](https://www.bennadel.com/resources/uploads/2012/ObjectCalisthenics.pdf) 46 | * [How Interfaces Are Refactoring Our Code](http://www.amihaiemil.com/2017/08/12/how-interfaces-are-refactoring-our-code.html) 47 | * [Your Constructors are Completely Irrational](http://blog.thecodewhisperer.com/permalink/your-constructors-are-completely-irrational) 48 | * [Class naming](http://objology.blogspot.com/2011/09/one-of-best-bits-of-programming-advice.html) 49 | * [Names objects after things, not actions!](http://matteo.vaccari.name/blog/archives/743) 50 | * [Interfacing with hard-to-test third-party code](http://misko.hevery.com/2009/01/04/interfacing-with-hard-to-test-third-party-code/) 51 | * [How to Think About the "new" Operator with Respect to Unit Testing](http://misko.hevery.com/2008/07/08/how-to-think-about-the-new-operator/) 52 | * [Avoiding Repetition](https://www.martinfowler.com/ieeeSoftware/repetition.pdf) 53 | * [Design Principles from Design Patterns - A Conversation with Erich Gamma](https://www.artima.com/lejava/articles/designprinciplesP.html) 54 | * [Programming Like Kent Beck](https://blog.iterate.no/2012/06/20/programming-like-kent-beck/) 55 | * [How Immutability Helps](https://www.yegor256.com/2014/11/07/how-immutability-helps.html) 56 | * [Clean Architecture](https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html) 57 | * [Hexagonal Architecture: three principles and an implementation example](https://blog.octo.com/en/hexagonal-architecture-three-principles-and-an-implementation-example/) 58 | * [Getting Started With DDD When Surrounded By Legacy Systems](http://domainlanguage.com/wp-content/uploads/2016/04/GettingStartedWithDDDWhenSurroundedByLegacySystemsV1.pdf) 59 | * [Clean Code in Python](https://testdriven.io/blog/clean-code-python/) 60 | * [Refactoring Legacy Code with the Strangler Fig Pattern](https://shopify.engineering/refactoring-legacy-code-strangler-fig-pattern) also available in [video](https://www.youtube.com/watch?v=zZ95_5y_iPk) 61 | * [Immutable architecture](https://enterprisecraftsmanship.com/posts/immutable-architecture/) 62 | * [The Humble Dialog Box by Michael Feathers](https://martinfowler.com/articles/images/humble-dialog-box/TheHumbleDialogBox.pdf) 63 | * [The Transformation Priority Premise by Uncle Bob](https://blog.cleancoder.com/uncle-bob/2013/05/27/TheTransformationPriorityPremise.html) 64 | * [How to Write a Git Commit Message](https://cbea.ms/git-commit/) 65 | 66 | ## Tutorials 67 | * [Refactoring a JavaScript video store](https://martinfowler.com/articles/refactoring-video-store-js) 68 | * [Bowling Game Kata](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata) 69 | * [Refactoring from anemic model to DDD](https://blog.pragmatists.com/refactoring-from-anemic-model-to-ddd-880d3dd3d45f) 70 | * [Writing Testable Code](http://misko.hevery.com/code-reviewers-guide) 71 | * [Essential Skills for Agile Development](http://www2.cpttm.org.mo/cyberlab/softdev/ESAD/) 72 | * [First Pop Coffee Company](https://buildplease.com/pages/fpc-1/) 73 | * [Testing legacy by Sandro Mancuso](https://codurance.com/2011/07/16/testing-legacy-hard-wired-dependencies/), [part 2](https://codurance.com/2011/07/18/testing-legacy-hard-wired-dependencies_17/), and [video](https://www.youtube.com/watch?v=_NnElPO5BU0) 74 | * [Live Refactoring Towards Solid Code](https://www.youtube.com/watch?v=jwJnd9ycs6Q) 75 | * [Introducing the Gilded Rose kata and writing test cases using Approval Tests by Emily Bache](https://www.youtube.com/watch?v=zyM2Ep28ED8), [part 2](https://www.youtube.com/watch?v=OJmg9aMxPDI) and [part 3](https://www.youtube.com/watch?v=NADVhSjeyJA) 76 | * [Domain Driven Design Crash Course](https://vaadin.com/learn/tutorials/ddd) 77 | * [Reactive in practice: A complete guide to event-driven systems development in Java](https://developer.ibm.com/series/reactive-in-practice/) 78 | * [Writing Clean Tests](https://www.petrikainulainen.net/writing-clean-tests/) 79 | * [Tic-Tac-Toe Speedrun live coding](https://www.youtube.com/watch?v=z4qvIaJhSkU) 80 | 81 | ## Videos 82 | * [How To Design A Good API and Why it Matters by Joshua Bloch](https://www.youtube.com/watch?v=aAb7hSCtvGw) 83 | * [Inheritance, Polymorphism, & Testing](https://www.youtube.com/watch?v=4F72VULWFvc) 84 | * [Don't Look For Things!](https://www.youtube.com/watch?v=RlfLCWKxHJ0) 85 | * [Don't Create Objects That End With -ER](https://www.youtube.com/watch?v=WpP4rIhh5e4) 86 | * [8 Lines of Code by Greg Young](https://www.infoq.com/presentations/8-lines-code-refactoring) Accompanied [slides](https://github.com/kkisiele/awesome-clean-code/raw/master/GregYoung_8LinesOfCode.pdf) 87 | * [19 1/2 Things to Make You a Better Object Oriented Programmer](https://vimeo.com/17151526) Nice [summary](http://www.simpletechture.nl/blog/2011/objectoriented/) 88 | * [Railway oriented programming: Error handling in functional languages](https://vimeo.com/113707214) 89 | * [Yves Reynhout - Trench Talk: Evolving a Model](https://www.youtube.com/watch?v=7StN-vNjRSw) 90 | * [Seven Ineffective Coding Habits of Many Programmers by Kevlin Henney](https://www.youtube.com/watch?v=ZsHMHukIlJY) 91 | * [Java Optional - The Mother of All Bikesheds by Stuart Marks](https://www.youtube.com/watch?v=Ej0sss6cq14) 92 | 93 | ## Code Examples 94 | * [Code Katas](https://github.com/kkisiele/codekata) 95 | * [hentai](https://github.com/jakubnabrdalik/hentai) 96 | * [Source code for the book, "Growing Object-Oriented Software, Guided by Tests"](https://github.com/sf105/goos-code) 97 | * [jcabi-email](https://github.com/jcabi/jcabi-email) 98 | * [Assignment done for some interview](https://github.com/kkisiele/loganalyzer) 99 | * [Library project](https://github.com/ddd-by-examples/library) 100 | * [Factory project](https://github.com/ddd-by-examples/factory) 101 | * [Aggregates by Example](https://github.com/mariuszgil/aggregates-by-example) 102 | * [DDD Leaven](https://github.com/BottegaIT/ddd-leaven-v2) 103 | * [ddd-wro-warehouse](https://github.com/michal-michaluk/ddd-wro-warehouse) 104 | * [Cargo](https://github.com/citerus/dddsample-core) 105 | 106 | ## Git Hub 107 | * [Nat Pryce](https://github.com/npryce) 108 | * [Steve Freeman](https://github.com/sf105) 109 | * [Matteo Vaccari](https://github.com/xpmatteo) 110 | 111 | ## Blogs 112 | * [Martin Fowler](https://martinfowler.com/bliki) 113 | * [Michael Feathers](https://michaelfeathers.silvrback.com) 114 | * [Robert C. Martin (Uncle Bob)](https://blog.cleancoder.com) 115 | * [Yegor Bugayenko](http://www.yegor256.com) 116 | * [Code Cop](http://blog.code-cop.org) 117 | * [The Code Whisperer](http://blog.thecodewhisperer.com) 118 | * [jbrains.ca](http://blog.jbrains.ca) 119 | * [Nat Pryce](http://www.natpryce.com) 120 | * [Steve Freeman](http://www.m3p.co.uk/blog) 121 | * [Miško Hevery](http://misko.hevery.com) 122 | * [Matteo Vaccari](http://matteo.vaccari.name/blog) 123 | * [Carlo Pescio](http://www.carlopescio.com) 124 | * [Jeffrey Palermo](http://jeffreypalermo.com) 125 | * [Kenneth Truyers](https://www.kenneth-truyers.net) 126 | * [Vaughn Vernon](http://forcomprehension.com/blog/) 127 | * [Codurance](https://codurance.com/publications/) 128 | * [Mihai](https://www.amihaiemil.com) 129 | * [Enterprise Craftsmanship](https://enterprisecraftsmanship.com) 130 | * [The Iterate Blog](https://blog.iterate.no) 131 | * [The Holy Java](https://theholyjava.wordpress.com) 132 | * [ploeh blog](https://blog.ploeh.dk/) 133 | 134 | ## Twitter 135 | * [Kent Beck](https://twitter.com/kentbeck) 136 | * [Martin Fowler](https://twitter.com/martinfowler) 137 | * [Robert C. Martin](https://twitter.com/unclebobmartin) 138 | * [Ron Jeffries](https://twitter.com/RonJeffries) 139 | * [Michael Feathers](https://twitter.com/mfeathers) 140 | * [Yegor Bugayenko](https://twitter.com/yegor256) 141 | * [Carlo Pescio](https://twitter.com/carlopescio) 142 | * [Matteo Vaccari](https://twitter.com/xpmatteo) 143 | * [Jeffrey Palermo](https://twitter.com/jeffreypalermo) 144 | * [Kenneth Truyers](https://twitter.com/kennethtruyers) 145 | * [Greg Young](https://twitter.com/gregyoung) 146 | * [Eric Evans](https://twitter.com/ericevans0) 147 | * [Vaughn Vernon](https://twitter.com/VaughnVernon) 148 | 149 | ## Books 150 | * [Refactoring: Improving the Design of Existing Code by Martin Fowler](https://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Technology-ebook/dp/B007WTFWJ6) errata for the book can be found [here](https://martinfowler.com/refactoringErrata.html) 151 | * [Clean Code by Robert C. Martin](https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship-ebook/dp/B001GSTOAM) 152 | * [Design Patterns: Elements of Reusable Object-Oriented Software](https://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional-ebook/dp/B000SEIBB8) 153 | * [Elegant Objects by Yegor Bugayenko](https://www.amazon.com/gp/product/1519166915/) 154 | * [Growing Object-Oriented Software, Guided by Tests](https://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests-dp-0321503627/dp/0321503627/) 155 | * [Code That Fits in Your Head : Heuristics for Software Engineering](https://www.amazon.com/Code-That-Fits-Your-Head/dp/0137464401) 156 | 157 | ## Other 158 | * [Code Katas](http://codekata.com) 159 | * [katalyst](https://www.codurance.com/katalyst) 160 | -------------------------------------------------------------------------------- /kent_beck_simple_design.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkisiele/awesome-clean-code/a93af686e76e8aeee4c03a3ab18d70df30fc92d8/kent_beck_simple_design.jpg -------------------------------------------------------------------------------- /principles_and_patterns.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kkisiele/awesome-clean-code/a93af686e76e8aeee4c03a3ab18d70df30fc92d8/principles_and_patterns.pdf --------------------------------------------------------------------------------