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.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)