83,022 views
Telegram post: https://t.me/koduryem/39 How to create a clean architecture and write clean code? What patterns are there? How to apply them? Why does everyone understand them differently? Can they be imagined without reference to a specific language? Why don't they work for someone? Did Uncle Bob deceive us? Should they be used in a small project, script or huge enterprise solutions? How to deal with complexity in our projects and make sure that the costs of making new changes are optimal with its growth? Is it possible to build a monolith of millions of lines and stay sane? We will answer and discuss these and other tricky questions in this video. There will be a lot of drawings with decoupling from specific implementations in a specific language, where possible. Where not - we will provide code. Somewhere we will pour water, how can we do without it; otherwise, the haters will have no work :) In general, here is everything you need to know how to apply and at what stage of the project. When their application gives profit, and when it greatly interferes and complicates the code. A lot about decoupling & cohesion, on which we will build reasoning at almost all levels of abstraction. The first chapters talk a lot and tediously about thinking, which will then permeate all the other chapters with a red thread of abstractions. Let's not forget about SOLID and some other principles. Let's mention cases when SOLID led to difficult-to-maintain noodles, and when it made the code beautiful and understandable. Somewhere we cringe a little. Everything as we love)) Not everyone and not everyone will be able to understand and even more so immediately apply in practice. Many things need to be developed as a skill, constantly reflecting, refactoring the code after each revision. But, we try to be better and use it if there is an opportunity to make our code better and more understandable for other people; code in which it is easy and pleasant to make new changes. I hope everyone will find something useful for themselves. So, it was not in vain that I did it. P.S. Any coincidences with reality are accidental, no topics other than development are touched upon either explicitly or indirectly. No statements, appeals, opinions, convictions, condemnations, criticism were made or intended to be made. Only publicly available information. Telegram post: https://t.me/koduryem/39 Telegram: https://t.me/koduryem Leetcode: https://leetcode.com/idfumg GitHub: https://github.com/idfumg Gists: https://gist.github.com/idfumg Timecodes 0:00 Intro 32:50 Black and White Thinking 45:55 Modeling & Abstraction 1:07:49 Single Responsibility Principle 1:38:52 Open-Closed Principle 1:58:26 Liskov Substitution Principle 2:18:32 Interface Segregation Principle 2:35:40 Dependency Inversion Principle 3:08:03 DRY 3:20:39 Naming 3:46:57 One Line One Statement 3:55:30 Function's Size 3:59:20 Loops 4:04:40 Classes 4:09:22 Low Coupling & High Cohesion 4:46:26 Technical Debt 4:52:09 Cyclic Dependency 5:00:37 Gateway (Facade, Orchestrator) 5:11:54 Function Composition 5:18:10 Pure Functions 5:56:26 Idempotent Functions 6:03:20 State & Stateful & Stateless 7:07:28 IO & Functional Core & Imperative Shell 7:39:32 Input Validation 7:47:24 Dependencies Are Bad 8:04:38 Dependency Inversion 8:19:26 Clean Architecture 8:31:38 Hexagonal Architecture 8:56:55 Clean Architecture. Example. Smoothly Increase Complexity 9:13:00 Clean Architecture. Using Functions 9:14:57 Clean Architecture. Using Closure 9:17:13 Clean Architecture. Using Class 9:22:53 Clean Architecture. Using Global Setup 9:28:16 Big Ball Of Mud 9:35:35 Distributed Monolith With Microservices 9:40:41 Monolith 9:47:42 Monolith. Martin Fowler 9:48:52 Monolith. KISS & Make It Work! 9:52:16 Monolith. Refactor. Decoupling. Modules 9:56:19 Monolith. Ultimate Decoupling. Broker (Sync) 9:59:10 Monolith. Ultimate Decoupling. Broker (Async) 10:01:07 Modular Monolith 10:03:32 Modular Monolith. High Coupling & Low Cohesion 10:04:44 Modular Monolith. Modularization & Refactoring 10:05:13 Modular Monolith. One Database And Direct Function Calls 10:06:37 Modular Monolith. Extract Modules to Microservices 10:08:11 Modular Monolith. Complexity Of Wrong Architecture 10:10:45 Modular Monolith. Complexity Of Wrong Decomposition 10:12:17 Modular Monolith. Scaling Of Monolith 10:13:35 Modular Monolith. Advantages Of Modules 10:15:42 Modular Monolith. Anti-Corruption Layer 10:18:10 Modular Monolith. One Module One Database 10:19:17 Modular Monolith. One Module One Schema 10:20:03 Modular Monolith. Disaster Of Using The Same Tables By Modules 10:23:44 Modular Monolith. Module Boundaries and APIs 10:26:52 Modular Monolith. Communicate With Broker 10:30:49 Data Transfer Objects (DTOs) 10:46:12 In-Memory Broker (Sync) 10:47:44 In-Memory Broker (Async) 10:49:43 Prototyping 10:55:34 Development Cycle 11:07:22 Just Enough Architecture 11:10:32 Architecture Complexity 11:19:51 Bla