The-Clean-Coder
Table of Contents
1. Chapter 1: PROFESIONALISM
1.1. Do no harm
No harm should be done to the function of our software. The harm comes about when there are bugs, the QA should find no bugs in the software. If the software is too complex to run without there being bugs, reduce the complexity of the software. Find ways to ensure that the code is designed so that it is easy to test. Aim for 100% test coverage, everything should be tested; automate the testing so you don't waste too much time.
1.2. Do no harm to the structure
It is the structure of your code that allows it to be flexible. If you compromise the structure, you compromise the future. If you want the software to be flexible, you have to flex it. This is done by making easy changes to it all the time, which is known as merciless refactoring.
1.3. Work ethic
Your career is your responsability and nobody else's. The 40 hours at work should be spent on the employers problems, and the extra 20 hours should be spent reading, practicing, learning, and otherwise enhancing your career.
1.4. Know your field
Do you know what a Nassi-Schneiderman chart is? If not, why not? Do you know the difference between a Mealy and a Moore state machine? You should. Could you write a quicksort without looking it up? Do you know what the term “Transform Analysis” means? Could you perform a functional decomposition with Data Flow Diagrams? What does the term “Tramp Data” mean? Have you heard the term “Conascence”? What is a Parnas Table? If you want to be a professional, you should know a sizable chunk of ideas, disciplines, techniques, tools, and terminologies and constantly be increasing the size of that chunk.
Here is a minimal list of the things that every software professional should be conversant with: • Design patterns. You ought to be able to describe all 24 patterns in the GOF book and have a working knowledge of many of the patterns in the POSA books. • Design principles. You should know the SOLID principles and have a good understanding of the component principles. • Methods. You should understand XP, Scrum, Lean, Kanban, Waterfall, Structured Analysis, and Structured Design. • Disciplines. You should practice TDD, Object-Oriented design, Structured Programming, Continuous Integration, and Pair Programming. • Artifacts: You should know how to use: UML, DFDs, Structure Charts, Petri Nets, State Transition Diagrams and Tables, flow charts, and decision tables.
1.5. Continuous learning
Read books, articles, blogs, tweets. Go to conferences. Go to user groups. Participate in reading and study groups. Learn things that are outside your comfort zone. If you are a .NET programmer, learn Java. If you are a Java programmer, learn Ruby. If you are a C programmer, learn Lisp. If you want to really bend your brain, learn Prolog and Forth!
1.6. Practice
Doing your daily job is performance, not practice. Practice is when you specifically exercise your skills outside of the performance of your job for the sole purpose of refining and enhancing those skills. More on this later.
1.7. Collaboration
Make a speacial effort to practice, program, plan and design together (not for 100% of your time).
1.8. Mentoring
The best way to learn is to teach.
1.9. Know your domain
It is the responsibility of every software professional to understand the domain of the solutions they are programming. If you are writing an accounting system, you should know the accounting field. If you are writing a travel application, you should know the travel industry. When starting a project in a new domain, read a book or two on the topic. Interview your customer and users about the foundation and basics of the domain. Spend some time with the experts, and try to understand their principles and values.
1.10. Identify with your Employer/Customer
Put yourself in your employer’s shoes and make sure that the features you are developing are really going to address your employer’s needs.
1.11. Humility
Professionals know they are arrogant and are not falsely humble. A professional knows his job and takes pride in his work. A professional is confident in his abilities, and takes bold and calculated risks based on that confidence. A professional is not timid. However, a professional also knows that there will be times when he will fail, his risk calculations will be wrong, his abilities will fall short. Be your own critique and never ridicule others, accept ridicule when deserved and laugh it off when it's not.