Craftsmanship is Refactoring

  1. Don’t Repeat Yourself. Be on the lookout for repeated phrases. Repetition is a major hideout for bugs. You should only need to edit one piece to make a complete change in the code. Having to edit multiple areas will cause confusion. Something will be overlooked. If you have to make multiple edits for a single change, it’s a good sign you need a new abstraction. This can be tricky. There are myriad ways in which code can be unintentionally repeated.
  2. Make the code expressive. Name everything well. Make it very clear what your methods do. Define methods just below their first use so that others don’t have to hunt through the code. Make it so that there are no surprises or confusion about what your code does. Expressive code is easy to understand. Good names will tell you how to improve their code’s quality.
  3. Make the code simple. Without repeating yourself, without glomming your code into an impenetrable sphere of mystery, and without losing the expressiveness of your names, make the code as simple as possible. The less your code resembles a Rube Goldberg machine, the better. Write less. Every bug ever written was written.

--

--

--

Software Crafter at 8th Light Consultancy, Organizer for Fullstack LA meetup, Eagle Scout, Theatre Person, Taoist Philosopher among other passions.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Deploy a Hasura GraphQL API for Salesforce in minutes — Make Salesforce API limits a thing of the…

10 Things I wish I knew before testing my Rails Application with rspec for the first time [Part 1]

Reduce DB upgrade downtime to less than 10 minutes using DMS on Google Cloud

Tidal Mod Apk Premium/ Unlocked 2021

Tidal Mod Apk Premium/ Unlocked 2021

How to Solve a Flutter Doctor Spits Out an Errors?

Building a gear-list planner for backpackers as my final project with React and Redux

Error 18456 Severity 14 State 38

Error 18456 Severity 14 State 38

Building Developer Relations Teams

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ian Carroll

Ian Carroll

Software Crafter at 8th Light Consultancy, Organizer for Fullstack LA meetup, Eagle Scout, Theatre Person, Taoist Philosopher among other passions.

More from Medium

Object-Oriented Design Patterns — Series of Notes

Graffiti on a concrete wall

Code refactoring

Double error!

Simple Team Management Practices