/the-clean-coder-summary

The clean coder book summary by Robert C.Martin

The Clean Coder Summary

Professionalism

  • Do no harm to function or structure of the code: don't introduce bugs, make sure your code is tested. If it can't be tested, write it in a way that is testable. If testing is too cumbersome, automate testing.

  • A true professional knows that delivering function at the expense of structure is a fool's errand.

  • Every time you look at a module you should look for ways to make small, lightweight changes to make it better. AKA, leave your code better than you found it even if you didn't write it.

  • Your career is YOUR responsibility, not your employer's. You owe your employer 40 hours a week, make sure you put in an extra some hours for yourself (reading, practicing, learning) to hone your skills and make sure you are developing in the areas you want to be developing in.

  • Know your field and know it well. Know design patterns and principles, methods, practices

  • Practice, Practice, Practice. True professionals keep their skills sharp and ready. Musicians don't get better by performing(doing your job), they get better by practicing (outside of work). The same rules applies to engineers.

Saying No

  • True professionals have the courage to say no to their managers. Pursue and defend your objectives as aggressively as you can. If you know full well that getting the job done by X date is not doable, but you still say "I'll try" then you are not doing the job right.

  • Your managers is counting on you to defend your objectives and not just agree with everything they say. Be assertive, both you and your manager need to get the best possible outcome through negotiations.

  • Conversations might be adversarial and uncomfortable, but that's all in the pursuit of a mutually agreeable solution and the best possible outcome.( the ultimate goal).

  • When it comes not being able to meet the deadline, the WHY is less important than the FACT that you can't meet it.

  • Make sure you have documentation (memos) for high stake deliverables/situations (CYA).

Saying Yes

  • Say it, mean it, do it.

  • Recognize lack of commitment phrases and words in others and yourself. They include: "need", "hope", "Let's see if we can get this done..."

  • The secret ingredient to recognize what a sincere commitment sounds like is to look for phrases that resemble "I will do something.. by this certain date...".

  • If you rely on someone else to get your job done, do what you can to get what you need to move forward. Don't let them be a blocker.

  • Bring up blockers or red flags as soon as they come up__Communicate

  • Professionals are not required to say "yes" to everything that is asked of them. However they should work hard to find creative ways to make the "yes" possible.

Coding

  • Be prepared to code for the day. Warm up with some short coding challenges. Cool down with some too.

  • Don't write code at 3 am or when you are preoccupied with something personal. You'll have to rewrite it later.

  • Spend personal time before work trying to resolve or mitigate personal issues or demands so you can focus you mental energy on being a productive problem solver at work.

  • Be prepared to be interrupted and help someone__it's the professional things to do.

  • When you hit writer's block make sure you are sleeping, eating and exercise enough. Additionally, read science fiction (or another form of creative consumption other than surfing the internet or watching TV). Lean on other creative consumption outlets to help keep you creative on the job.

  • Save yourself time from debugging and practice TDD. Also debugging is technically considered productive coding too. Don't discredit debugging as 'non coding work'

  • Software development is a marathon__not a sprint. Conserve your mental energy during the day.

  • "Hope" will get you into the trouble. Don't hope. Be direct about time-lines and realistic expectations. If you must, use an estimate/range.

  • Ask for help and ask to give help (mentor).

TDD

  • Good test function like good documentation.

  • TDD is a discipline that enhances certainty, courage, defect reduction. documentation and design.

  • It's professional to use TDD.

Practicing

  • It is not your employer’s job to keep your skills sharp for you. That onus is on YOU.

  • Practice coding outside of work by doing kata. Coding kata means simulating the solving of some programming problem that you should already know the solution to; you are just practicing movements to drive problem/solutions pairs into your subconscious.

  • Other ways to practice: take on pro-bono work or a pet project, contribute to open source.

  • Practice is something you do when you aren’t being paid.

Communicating

  • Professional developers remove ambiguity from requirements.

  • Acceptance tests should be automated and written by the business for the business.

Testing

  • Teams should have a testing strategy defined.

  • Professional use automation testing pyramid

Time Management

  • Professional software developers are diligent in the management of their time.

  • Meetings are necessary AND huge time wasters.

  • You do not have to attend every meeting — be careful about which ones you decline and choose to attend. Your responsibility is to YOUR PROJECT first. You should work with a manager about how to reduce meetings from your schedule.

  • Politely leave a meeting if it is not worth your time.

  • Meetings should have a clear agenda and if they steer away from that agenda then someone should table the actual meeting agenda for another time.

  • Daily stand up should be 20–30 seconds per update; what you did yesterday, what you are working on today, and any blockers.

  • IPM = Iteration planning meeting where a team selects backlog of stories for the next iteration (I know this already, but didn’t know it my first day on the job).

  • Try time-boxing and/or tomato timer idea: Use a 25 minute timer and focus on the task at hand during that 25 minutes. If any interruptions come up, defer them until your time is up. Once your timer is up, address all the issues that came up and take a quick break. Then, restart the timer and continue to focus. Track your work by how many 25 minute tomato timers you can get through in a day.

  • Professionals evaluate priority of each task, disregarding personal fears and desires, and execute in priority order.

Estimation

  • You are honor-bound to decline something you cannot commit to. Commitment is about certainty.

  • Professionals know the difference between estimates and commitments.

  • Estimates are just guesses. Estimates are ranges (not exact numbers).

  • Avoid the word “try”. It’s a loaded term.

  • Something to look into is a method like PERT to get a better estimate.

  • Professional software developers are very careful to set reasonable expectations despite the pressure to try to go fast.

  • Estimating methods: wide band delphi, flying fingers, planning poker.

Pressure

  • A professional developer is calm and decisive under pressure. As pressure grows, she adheres to disciplines knowing that they are the best way to meet the deadlines and commitments pressing on her.

  • Under pressure? Be sure to manage your commitments, follow disciplines, and keep code clean, communicate, and ask for help.

Collaboration

  • Programmers have difficulty working closely with other programmers. That’s no excuse, though. Being a developer means working with people.

  • The team owns the code, not the individual

  • Professionals pair (and have good pairing habits).

  • Pairing is a great way to share knowledge so that people don’t end up in knowledge silos.

  • All team members should be able to play another team members’ position in a pinch and should know each other’s code.

Team and Projects

  • Strive to have a “gelled” team. A gelled team is one that forms relationships, collaborates, and learn each other’s quirks and strengths.

  • Gelled teams can work miracles. They plan together, solve together, and get things done.

Mentoring, apprenticeship, and craftsmanship

  • You can’t learn the skill of being a craftsman (aka, a professional) from school; you learn that from mentoring and apprenticeships.