DEV Community

Cover image for Doubly meaningful variable names
Tom Harvey for InRange

Posted on

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.

Top comments (0)