DEV Community

loading...

Code is for Humans

internettradie profile image Ryan Ameri ・2 min read

Getify's Avatar
These are some of the gems that can be found watching Kylie Simpson's Code is for Humans presentation at Frontend Masters. The talk is available for free and in my opinion, a must watch for new web developers. Here is my brief overview.

If you don't know why your code works, you have no hope of fixing it when it breaks. --getify's law #42

The inability to understand how code works so that it's quicker to rewrite is a universal problem. The difficulty of understanding code stems from our inability/unwillingness to insist that our code communicate our ideas clearly.

There are infinite number of ways to write the same program. But in the 60+ year history of computer science, we've prioritised writing code primarily for computers instead of optimising for the people who are going to read them.

Code is for communicating ideas with other people.

Instead of prioritising writing the fastest code, we should prioritise other metrics. For example, how many of our lines of code are going to survive the next cycle of when someone in future will refactor our code (that someone could be our own future self)? The only way to ensure our code is going to survive is to make it readable. If our code has to be rewritten to be fixed, we have failed.

Refactoring to make the code more readable is, not just a great idea, but essential. Take 10% of your time, 6 minutes out of every hour, to make your code more readable. Every moment we invest in making code readable will directly pay off, and impacts our ability to do our job. Readability is not just something good to have, it's the whole point.

The one thing that we will always be better than computers is how to communicate with other people. We should focus on that.

Code that you do not understand is code that you cannot trust, and code that you cannot trust is code that you do not understand

Discussion (2)

pic
Editor guide
Collapse
incrementis profile image
Akin C.

Hello Ryan Ameri,

thank you for your article.
This is a very powerful sentence in my opinion that can easily be shared even to managers/people who do not understand software development or coding in general.
"...Code that you do not understand is code that you cannot trust, and code that you cannot trust is code that you do not understand..."

Collapse
abdisalan_js profile image
Abdisalan

Awesome post Ryan :)