Check out a free preview of the full ES6: The Right Parts course:
The "Optimizing Code for the Reader" Lesson is part of the full, ES6: The Right Parts course featured in this preview video. Here's what you'd learn in this lesson:

Kyle wraps up the course with a few final thoughts about writing code for the reader not the writer.

Get Unlimited Access Now

Transcript from the "Optimizing Code for the Reader" Lesson

[00:00:00]
>> [MUSIC]

[00:00:03]
>> Kyle Simpson: Just to recap, the whole point of looking at ES6, it's not about finding shiny new toys or looking cool tricks to make ourselves feel smarter, it's about finding ways to write code that is clearer and more self descriptive. Because we would like to optimize our code more for the reader than for the writer.

[00:00:23] Oftentimes, code that's optimized for the reader is also optimized for the writer but the reverse is not true. When we optimize for ourselves, oftentimes we forget about who needs to maybe consume our code. Another member of our team, somebody a couple of years from now, or even our future selves coming back to code.

[00:00:41] Cuz I look at code I wrote a week ago and I'm already lost. I don't know maybe I'm the only one, but I'd like to get a lot better at writing code. I have this sort of ideal that maybe the best code, best, is code that explains itself, code that teaches itself.

[00:00:59] Someone with no prior knowledge of my domain space or the problem I'm trying to solve, could sit down and at one glance, one read through of my code, perfectly understand everything that I was thinking about. All the choices I made and why I made them. It's probably not possible, but that's the ideal that I strive towards.

[00:01:17] I look for every opportunity to use what I know about the language to go towards that goal. And I encourage you to try to do some of that yourself. Hopefully, ES6 will help you along the way. It's been an honor being here. Thanks for everybody listening and paying close attention.

[00:01:32] Thanks for all the great questions. Thank you to all of you that listened online and for those of you that are watching the course later, I appreciate it very much. If you have any questions, feel free to reach out to me on Twitter. Check out the book series, the unit JS books also is another quick little plug.

[00:01:47] I've started on my eighth book now, not part of this series. I'm writing a book called functional light JavaScript, which is gonna look at functional programming, from the ground up rather than from all the heavy terminology down. So that's being also written up on GitHub, follow along with that if you're interested.

[00:02:03] Thanks for being here, appreciate it.