June 14th update

The three pillars of clean code

After conversations with developers, reading books like Clean Code, The Pragmatic Programmer, and Domain-Driven Design, and completely scraping Chapter 3 and re-starting it, I've settled on a framework that I think makes sense for understanding the nebulous topic of clean code.

It's called the Three Pillars of Clean Code

/book-assets/Software Design and Architecture Wiki 16ec9c6a09b3410ca7be7920be75e128/Updates 6a4d804e388747418a713a4dc09c64e3/June%2014th%20update%202c240d5fa2bc475f92296043c4a13eab/Screen_Shot_2020-06-14_at_10.51.32_AM.png

The pillars of clean code is:

  1. 🧠 Developer Mindset
  2. ⚙️ Coding Conventions
  3. 🤹🏻 Skills & Knowledge

Developer mindset

Design thinking, empowering humans, adding value, rejecting perfection, and growth from failure.

Why bother coding?

Why do you even bother to code? Is it just something you do for money? Do you like it? If you're not passionate about what you're doing, how can we expect your code to be clean? The first step is giving a st*.***

Programming = engineering or a trade?

Schools have promoted programming as an engineering or scientific discipline. While there might be a lot of theory involved in computer science, 95% of what we do on a daily basis are highly specific tricks of the trade passed down to us from more experienced developers. In this section, we draw very strong comparisons between programming and apprenticeship model originating from medieval Europe used to train butchers, carpenters, and steel-smiths.

Software developers are also software designers

There's a reason why schools aren't teaching:

  • Naming things
  • When to comment code
  • Formatting and styling code
  • How to organize code
  • Testing

Two reasons:

  • 1 — these are skills passed down through apprenticeships & training
  • 2 — there's no objectively correct answer to them. Their effectiveness relies on our understanding of human psychology. Design is the push/pull that can help us take human factors into writing empathetic code.

In this section, we learn about the basic (human-centered) principles of design.

  • Affordances
  • Constraints
  • Feedback
  • Conceptual models
  • etc..

We also touch on how they appear in code, and how they can be leveraged to improve developer experience or completely destroy it.

Coding conventions

The practical application of programming using standards, tools, approaches, and methods to produce the highest quality software possible.

Coding conventions are our preferred ways to approach writing software that relies on every practice, principle, and approach that we currently know (or don't know).

In this chapter, we address the tribal topics not taught in school. Prepped with our newfound ability to use human-centered design, we can finally formalize ways to:

  • Name things
  • Handle comments
  • Format, style, and enforce conventions
  • Organize code
  • Handle errors and exceptions
  • Test
  • Refactor

Skills & knowledge

Theoretical knowledge about software design and architecture which influences our preferred coding conventions.

The Dunning–Kruger effect states that smart people think they're dumb, and dumb people think they're smart. The more you learn about software design and architecture, the less you're going to realize you know.

As you learn design patterns, principles, practices, and approaches, you're going to want to reflect on your coding conventions, and swap out old approaches for new ones.

This is the equivalent of upgrading the tools in your toolbox over time.

Other updates

You can read recent updates now

Some readers asked for the ability to see when new things were added. I've added a "What's new" section right under the fold for y'all. You can see the the biggest & latest changes to the book.

/book-assets/Software Design and Architecture Wiki 16ec9c6a09b3410ca7be7920be75e128/Updates 6a4d804e388747418a713a4dc09c64e3/June%2014th%20update%202c240d5fa2bc475f92296043c4a13eab/Screen_Shot_2020-06-14_at_10.57.45_AM.png

Better EPub, PDF, and Kindle versions

Some of the previous versions had missing code blocks :( I fixed that and also adjusted some of the styling. I'm currently using pandoc to create versions of the book (which has been ok) but I'm experimenting with other tools as well.

What's next?

Two of the three pillars of clean code are covered: Developer Mindset & Coding Conventions.

Content goals of the next release

  • Finish Chapter 3 — To provide practical guidance on Organizing things, Testing, Refactoring, Errors and exception handling
  • Complete the third pillar of clean coding — skills & knowledge. It's not entirely complete yet, but essentially, where the coding conventions are the things we use in our daily programming jobs, it's the skills & knowledge of principles, practices, patterns, and anti-patterns we acquire throughout our career that we use to refine and hone better coding conventions.

Product goals

  • Better publishing experience — The book was previously being written as pure markdown in a Gatsby site. That's proven to be pretty poor, especially for content as linked as this. I've moved all my writing to Notion, but I'm not gonna lie — transferring the content over and creating ePub, PDF, and kindle versions was not a fun process (took me around ~3/4 hours to do). That's pretty unacceptable. I discovered that I can export all my content from Notion as markdown, so I'm looking into making that publishing process as seamless as possible.
  • Better online reading experience — This content is extremely linked. As I push through and finish Chapter 3, I'm really starting to think I made a good decision to create this product as half book, half paywalled wiki. Most of the coding conventions we touch on in the second pillar of clean code rely on (or are related to) to very important design principles and patterns. You're encouraged to dive deeper into the principles that formulate the coding conventions, and I'd like to make the online reading experience to do this, better. Stay tuned.
  • Updates once every week or two weeks — Full transparency, I've fallen on some turbulent times over the last few months. I started at Apollo, my partner and I separated, my uncle died, and then COVID happened. Things have been getting back to normal, and I'm a lot more confident I'm going to be able to provide regular updates. Thanks so much again for understanding.