• Home
  • Writing
  • Resume
  • Home
  • Writing
  • Resume

Writing

  • Why Some Managers Look Disingenuous

    January 3rd, 2024
  • Do’s and Don’ts For Technical Interviews

    December 27th, 2023
  • The Book That Made Me Want To Be A Leader

    October 30th, 2023
  • How to Fail An Interview As the Interviewer

    October 25th, 2023
  • Should Managers Be Prescriptive?

    October 16th, 2023
  • How To Help Unmotivated Developers

    July 12th, 2023
  • What to do when nothing seems good enough

    July 10th, 2023
  • Why Do We Burn Out?

    July 7th, 2023
  • What I Taught You, I Don’t Know

    June 21st, 2023
  • How To Delegate Effectively Without Feeling You Are Losing Control

    June 12th, 2023
  • Let’s Accept It. Technical Interviews Are Broken

    June 7th, 2023
  • Why Managers Need Empathy to Manage Low Performers

    May 31st, 2023
  • The Slow Decline of Highly Motivated Developers

    May 24th, 2023
  • Why Writing Explicit Code Matters

    May 18th, 2023
  • Why Is It So Difficult to Assess Expertise in an Interview?

    May 15th, 2023
  • The Real Value of a Senior Developer When it Comes to Dealing With Uncertainty

    May 11th, 2023
  • Why You Should Use Feature Flags to Deploy with Confidence

    April 28th, 2023
  • Over-Engineering Is Not (Just) a Technical Problem

    March 20th, 2023
  • The proactivity fallacy

    January 25th, 2023
  • Extending typescript intersection with optional properties

    January 18th, 2023
  • Setting up Google Tag Manager in a Nextjs application with a strict content security policy

    December 27th, 2022
  • How to build a scalable folder structure for a nextjs app

    December 11th, 2022
  • Why I have stopped writing comments

    December 6th, 2022
  • How to efficiently type nextjs page's props

    December 6th, 2022

Why Writing Explicit Code Matters

May 18th, 2023

Explicit code, code that clearly shows its intent, it’s good. we all agree. And yet most of us don’t write explicit code, we write code with all kinds of implicit meanings that we try to covey via online comments or documents. Why is that?

When we are writing code we have all of its meaning in our heads and in most cases, any code we write will look like expresses its intent explicitly, so we look at it and are happy with it. That’s our mistake.

The mistake is that we don’t go back and revisit our code, questioning our decisions about naming and general structure and trying to find a way of writing the code that makes comments obsolete. We have code that works but that is not good code.

Explicit code is important because it can be understood by someone who doesn’t have any context about it, the code itself provides the context. Explicit code is code that can evolve. Implicit code is code that will rot.

Explicit code is code that can evolve. Implicit code is code that will rot.

Best practices to follow and improve

Peer reviews from someone with fresh eyes always help, but in my experience, not all developers will pay attention to this matter in code reviews, and also, I think you should not depend on others to make your code good.

If you’re writing your own code pay attention to the comments you write. Each comment is a sign that your code is not explicit enough to be understood without a comment

If you are reading somebody else’s code and you need to go back over and over the same piece of code and you feel the naming doesn’t help following the code, there’s another sign of code without explicit intent. Improve it, don’t be afraid of changing it, even if other people think it’s irrelevant or that you’re just being a perfectionist. People in the future will thank you.

Try to review your own code after one or more days of writing it. You’ll be surprised at how much context you have forgotten and how little you get from the code. Use that as a tool to identify where you can improve it.

Conclusion

At the end of the day, good or bad code is subjective and each of us has different preferences. But if you write code with explicit intent there’s a good chance that people will consider it good code.