Clean Coder # 01. Professionalism
1.Professionalism
1.1. What I ask for?
📌What is Professionalism?
It is a marker of responsibility and accountability.
📌Core of Professionalism
You see value of company as same as value of yourself.
1.2. Taking Responsibility
📌Taking Responsibility even though it makes you feel awkward
I should have taken responsibility and told manager that the tests weren’t complete and that I was not prepared to ship the software on time. That would have been hard, and manager would have been upset. But no customers would have lost data, and no service managers would have called.
1.3. Do No Harm
📌Hippocratic Oath[^1]
First goal and responsibility, of an aspiring professional is to use his or her powers for good.
📌What is harm?
Harm to both the function and structure of the software.
1.3.1. Do No Harm to Function
📌What should I do?
You must be responsible for your imperfections.
Write perfect software is impossible does not mean you aren’t responsible for the imperfection.
It won’t ever get to zero BUG, but it is your responsibility to get as close as possible to it.
📌Try Your Utmost to Test
Ideally, QA Should Find Nothing. Releasing code to QA that you don’t know works is unprofessional.
📌You Must Know It Works
You only write code because you expect it to get executed. If you expect it to get executed, you ought to know that it works. The only way to know this is to test it.
📌When You Feel Hard to Test
The solution to that is to design your code to be easy to test. And the best way to do that is to write your tests first, before you write the code that passes them.
1.3.2. Do No Harm to Structure
📌A Good Structure
It is able to make changes without exorbitant costs.
📌How to Make a Good Structure?
If you want your software to be flexible, you have to flex[^2] it!
📌Are You Afraid to Modify Your Code?
Why do most developers fear to make continuous changes to their code?
They are afraid they’ll break it!
Why are they afraid they’ll break it?
Because they don’t have tests.
📌When You Are Not Afraid
If you have an automated suite of tests that covers virtually 100% of the code[^3], and if that suite of tests can be executed quickly on a whim, then you simply will not be afraid to change the code.
1.4. Work Ethic
📌Bad Example
Woe to the software developer who entrusts his career to his employer. Since your career is your responsibility. It is not your employer’s responsibility to make sure you are marketable.
📌20 Hours per Week
You should be reading, practicing, learning, and otherwise enhancing your career in your 20 hours per week.
📌Minimal List for Every Software Developers⭐⭐⭐
- Design Patterns
- Design Principles. (SOLID)
- Methods. e.g. XP, Scrum, Lean, Kanban, Waterfall, Structured Analysis, Structured Design
- Disciplines. TDD(Test Driven Design), Object-oriented design, Structured programming, Continuous Integration, Pair Programming
- Artifacts. UML, DFDs, Structure Charts, Petri Nets, State Transition Diagrams and Table, flow chart, decision tables
📌Continuous Learning
Woe to the architects who stop coding—they will rapidly find themselves irrelevant.
Woe to the programmers who stop learning new languages—they will watch as the industry passes them by.
Woe to the developers who fail to learn new disciplines and techniques—their peers will excel as they decline.
📌Practice
Do a kata[^4] twice a day in order to keep fingers used to hitting shortcut keys, or using certain refactorings.
📌Know Your Domain
You don’t have to be a domain expert, but there is a reasonable amount of due diligence that you ought to engage in. When starting a project in a new domain, read a book or two on the topic.
📌IDENTIFY WITH YOUR EMPLOYER /CUSTOMER
Your employer’s problems are your problems. 别骂老板,别骂客户。
📌Humility
谦逊。