My Authors
Read all threads
Clean code is only in part about the cleanliness of code.

To me, it's actually about:

🧠 Developer mindset (empathy, craftsmanship)
⚙️ Coding conventions (formatting, style, naming)
🤹🏻 Skill & knowledge (refactoring, testing, patterns, best practices)
🧠 Mindset.

Developers with an empathy mindset seek to write code so clear and clean that it empowers their peers, themselves, and their future maintainers to continue to contribute in meaningful ways.
Empathetic developers:
- care about the problem domain
- care to learn about the business
- face their social anxieties to ask important questions before writing code
- try to avoid being clever
- push back on impossible deadlines
Empathetic developers are aware of their own shortcomings, their gaps in knowledge, and seek to fill 'em.
Empathetic developers know that no solution is ever perfect, and never will be. They invest in their knowledge, their craftsmanship abilities, and seek to:

- Detect code smells
- Avoid anti-patterns
- Familiarize themselves with best practices
⚙️ Coding conventions

Conventions are a consistent set of rules that make code easy to read and maintain.

Craftspeople usually have their own opinions.

Empathetic craftspeople work with the team to come up with a consistent strategy that works for everyone.
Coding conventions are subjective and constantly debated in our industry.

- Do we like comments?
- Semi-colons?
- Should we start with failing tests?

The strategy y'all choose doesn't matter as much. Being on the same page as your team is what really matters.
🤹🏻 Skill & knowledge.

Craftspeople understand that their problems are not unique.

They understand that common patterns & approaches emerged for a good reason.

We have problems to solve, and we've found ways to solve them.
The Fundamental Goal of Software: "To continually produce something that satisfies the needs of its users while minimizing the effort it takes to do so".

If *change* is a constant in software, we need to optimize for:

- Understandability
- Flexibility
- Maintainability
Understandability: Can we write code that clearly expresses the intent?

Naming things is hard. As a best practice, we have the 7 principles of naming

Consistency, understandability, specificity, brevity, searchability, pronounceability, austerity.

namingthings.co/naming-things-…
Flexibility: Can we change this code?

Code incapable of change is dangerous. To remedy this, craftspeople research these topics:

- Dependency Inversion
- Composability
- Packaging Principles
- Boundaries
- Separation of Concerns
- Cross-cutting Concerns
Maintainability: Can we keep the code working?

If an old feature breaks every time you add a new one, that can make it very hard to keep your code afloat.

To solve this, craftspeople invest into learning how to write testable code & tests.

They push new code with confidence.
To a craftsperson, nothing feels better than a job done well. A healthy codebase.

It isn't as glamourous as pioneering a new tech stack or writing your own library- it's being a team player.

It's surprising how fulfilling writing boring code can be.

⛳ Where do I go from here?

Clean code is the start of the journey.

Here's a roadmap that shows you where the road leads, from Clean Code to Programming Languages, to Design Patterns, and full-on architectural approaches like DDD and Event Sourcing.

khalilstemmler.com/articles/softw…
To recap:

🧠 Get your mindset right. Focus on being empowering your team with the code you write. Have conversations, ask questions, **care** about the problem you're solving.
⚙️ Decide on a set of coding conventions that works for you and your team. Be consistent.
🤹🏻 Never stop investing in your skills & knowledge.
Seek out the well-known solutions to well-known problems in software design.

Learn the best practices.
Learn when to follow 'em.
Learn when to break 'em.
Knowing when to follow/break best practices comes with time.

But you need to know the rules first to know if you can break 'em.

The book, the Design of Everyday Things, teaches you how to design with empathy for the user.

Clean code is about empathy for those who work with our code.

Design with empathy for your team & future maintainers.

Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Khalil Stemmler

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!