DEV Community

Cover image for Doubly meaningful variable names
Tom Harvey for InRange

Posted on

2

Doubly meaningful variable names

Header image by Lucian Petrean CC


Giving meaningful names to our functions and variables helps communicate the context around our code.

Inspired by a LinkedIn post from Lowell Bander I recognised another layer of meaning in my code; one that communicates the motivation for why I code.

Here’s a snippet I was working on:

Meaningful code about solar generation and carbon savings

I’ve already posted about why now is the best time to work in the energy industry and it’s nice to have frequent reminders that the work is important. We’re installing solar and avoiding carbon emissions - tonnes of it!

Just as we all prefer different naming conventions, we all find motivation from different places. I hope that you can look at your code today, put aside debates about Hungarian notation, camelCasing or PEP 8 and recognise something which gives you a sense of meaning and purpose.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

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

Okay