DEV Community

Steven Mercatante
Steven Mercatante

Posted on • Edited on • Originally published at stevenmercatante.com

1 1

Code With Intent


This post was originally published at https://stevenmercatante.com


When people ask what makes someone a senior software engineer, they tend to get the same responses: ability to ask meaningful questions, mentoring others, putting aside one's ego, technical ability and so on. But, there's something else that is just as essential that is rarely mentioned: making the intent of your code clear.

This can be accomplished a few ways:

  • variables and functions have clear names that express their purpose
  • functions are small and have only one responsibility
  • code should be self documenting, but if that's not possible...
  • ... comments should be added that explain why the code is written this way, and how it works
  • functions and classes are organized so that new contributors can quickly find what they're looking for

It's easy to neglect some of the above when you're new to programming, or under tight deadlines. But making the effort is absolutely worth it. Your code will be easier to understand, easier to test, and easier to refactor. New contributers will thank you. Future-you will thank you, too. After all, there's nothing worse than coming back to a codebase you wrote 6 months ago and wondering what the hell is going on. So take the time now to make your intent clear - even if it only helps future-you, it'll be worth it.

👋 Enjoyed this post?

Join my newsletter and follow me on Twitter @mercatante for more content like this.

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay