- The importance of clean names
- Naming classes and types
- Rules for naming local and member variables
- Why clean formatting matters
- Making good use of loops
- Keeping your unit tests isolated
Skill Level Intermediate
- [Scott] When you write code, who are you writing it for? The easiest answer is that you're writing it for the computer, or more specifically, the compiler or interpreter for the language that you're writing in. That's true, your compiler or interpreter needs to be able to understand your program well enough to execute it. What's another audience? In many professional settings, you're not writing code in complete isolation. There are other people on your team. And those people need to be able to understand the code that you've written. Chances are pretty good that you're going to need to revisit your code and need to understand what it does, how it works, and why it was written that way. The chances are high that another human will need to work with your code in the future and this is likely to happen after you're not available to answer questions. Four different groups, but the last three have something really important in common. They're all human. So we need to make sure that we're creating code that can be easily understood by humans. That's where clean code principles come into play. By following them, you will ensure that you're crafting code that will be understood by anyone who happens to read your code in the future, be it one of your teammates when doing a code review, your future self when fixing a bug, or your successor when adding a feature. Hi, I'm Scott Ford. I'm the co-founder of Corgibytes, a company that specializes in remodeling software and paying down technical debt. So let's dive in and cover how you can start writing clean code.