Materials and samples for my workshops on Clean Code and Design Principles
https://milan2017.codemotionworld.com/workshop/clean-code-design-principles-kata/
As developers, we often feel that we are always asked for more: more features, more bugfixes, more code to get our application done, faster. In the workshop you'll learn first hand how applying Clean Code and Design Principles will help you complete solid & maintainable applications in less time.
We are often asked for more features, more bugfixes, faster. But is "running" always the fastest way to get things done? For a mountain climber, "running" means more mistakes, falling off more often,thus proceeding more slowly. So like a climber gets to the top through a continuous chain of small, safe steps, we can improve coding by making design & implementation steps clean, safe and incremental. In the workshop, starting from concrete examples, you will learn first hand how applying Clean Code and Design Principles will help you complete more solid & maintainable applications in less time
Laptop Web Browser (Chrome or Firefox) Text Editor (Sublime, Atom, Visual Studio Code,...) and/or IDE (Eclipse, NetBeans, Intellij, Visual Studio,.. )
How does our code become unmanageable? A practical example
- fast-forward demo through the life of an (apparently) trivial function
- the effects: code-writing time vs application-ready time
- what happens after 6 months?
- why this happens? the "deadly sins" of development (cut & paste, optimization lust, haste, false savings, naming avarice, trial and error wrath, my code is perfect pride, making it right is too hard - discouragement)
Clean Code, Design Principles and Lean to the rescue
- improving our code
- improving our design
- practice, practice, practice and continuous / daily improvement (Kaizen)
-reading code vs writing code
- what is a good name?
- same but different: the importance of conventions
- be meaningful
- aside: commit messages
- making code readable
- making code diff-friendly & commit-friendly
- making code modification-friendly
- single responsibility
- separing inputs from outputs
- if you have to do 3 things, make 4 functions
- primitives and orchestrators
- Single Responsibility Principle
- collaborating with other classes
- composition vs inheritance (and the Open/Closed principle)
- Dependency Injection
- interfaces and the importante of Contracts
- avoid statics
- testable code vs good design
- one task - one statement
- make return values visible
- logging
- from bad code to good code
- in steps
- learn your IDE refactoring tools
- The "Boy Scout Rule"
- Why we need unit tests?
Rewriting the initial example in a cleaner way
So what did we just do? Understand the principles
- the relationship between quality and productivity
- the need for a continuous chain of small, safe steps of design & implementation
- how to do everything incrementally
- Separation of Concerns in practice: ask yourself questions!
- incremental implementation: in-application Mocks & the Walking Skeleton approach
- how to keep track of what you do and what is missing
- how to manage incremental commits
- the feedback loop
- splitting the problem
- getting more feedback
- getting feedback more frequently
- model the problem
- avoid trial and error, but if you need it, do it fast
- Principles of Package Design
- More on TDD
For each module, hands-on lab will include
- quizzes (which of these variants is better? trade-offs)
- interactive examples to complete and modify in an online IDE
Basically, to all developers! Independently from the language / platform you are developing on, and from your expertise level, if you are interested in improving your approach to coding, and develop higher quality applications with more productivity, this workshop is for you.
Working knowledge and practical experience in one programming language (you should be able to write/compile/test/debug by yourself a program which reads and parses input and presents output either on the command line or in a simple GUI). Basic knowledge of HTTP.