Writing clean code is an essential part of any developer’s toolkit. Not only does it ensure legibility, but it also helps you and other developers understand what your code is doing at a quick glance.
In this article, I’ll share with you the key takeaways from Nacho Vazquez’s session on writing clean code. These points can be found in Uncle Bob’s book “Clean Code: A Handbook of Agile Software Craftsmanship”.
🔗Nacho Vazquez @nacho_devc
- Software Engineer, This Dot Labs
- Clean code is more of an art and intuition!!
- To become effective at writing clean code, constant practice is needed!
- In order to write clean code, a combination of proper naming with variables, functions and components is needed.
- Don't be afraid to use long names for your variables
🔗Naming Lessons for Programming!
- No abbreviations
- Avoid disinformation
- Make meaningful distinctions
- Pronounceable names
- Searchable names
- Use domain-specific names
- Abstraction and code-splitting is effective, yet needs to be managed carefully
- Don't Repeat Yourself
- Write Everything Twice
- Avoid Hasty Abstractions
- You Ain't Gunna Need It
- Don't abstract prematurely. Wait until it becomes necessary (if your code starts to become hard to read for example).
This Dot Labs is a modern web consultancy focused on helping companies realize their digital transformation efforts. For expert architectural guidance, training, or consulting in React, Angular, Vue, Web Components, GraphQL, Node, Bazel, or Polymer, visit thisdotlabs.com.
This Dot Media is focused on creating an inclusive and educational web for all. We keep you up to date with advancements in the modern web through events, podcasts, and free content. To learn, visit thisdot.co.