DEV Community

Sam Jarman 👨🏼‍💻
Sam Jarman 👨🏼‍💻

Posted on

When you see great code, ask yourself why it is great and can you replicate it? (100 Bytes Of Wisdom: Day 71)

When you see great code, ask yourself why it is great and can you replicate it?

About two years ago now I had a colleague who wrote some truly lovely JavaScript. Annoyed at myself for not being able to write it so nicely, I chose a reasonably new approach for me and decided to study their code instead. I looked carefully at the choices they'd made for structure and syntax and even asked them how they thought of doing things the way they did. Eventually, I was able to write code in the style that I grew to admire of theirs and I was super happy.

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com/

Top comments (0)