Naming Variables - Deepstash
Naming Variables

Naming Variables

It is pretty obvious that the names of variables matter. But oftentimes when we are in the middle of a hard problem, thinking about the name of a variable is too much for our cognitive capacity, so we just choose the first thing that comes to mind.

But we can increase our naming abilities while reviewing other people’s code. When you see one of their variables for the first time, take a few seconds to try to predict what it will be used for, and later evaluate how accurate its name was. Overtime, this should increase your intuition about good variable names.

142

922 reads

The idea is part of this collection:

The Halloween Collection

Learn more about books with this collection

Navigating and enjoying the thrill of horror and scare experiences

Historical knowledge of Halloween and its origins

Understanding and appreciating Halloween traditions worldwide

Related collections

Similar ideas to Naming Variables

Principle #14 We almost always have imperfect information on hand with which to make decisions

Pretty much every real life decision that comes up can go an infinite amount of directions. You simply can't calculate or know for sure what will happen based on your actions. There are too many variables. Just to name a few, there are reactions of anyone involved, unexpected setbacks (bad weathe...

Having a name for it might help

Having a name for it might help

Psychologists find that one of the best strategies for managing emotions is to name them. 

We still have a lot to learn about what causes languishing and how to cure it, but naming it might be a first step. 

It could help to defog our vision, giving us a clearer window into what had b...

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Personalized microlearning

100+ Learning Journeys

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates