Environmental Variable

Daisy Manmohan Singh
3 min readApr 16, 2021

Well New to Programming or had a tug of war with variables You must had Faced the term Environmental Variable.

Well, we had Local Variable, Global Variable in our Code But what is the Environmental Variable.

Well, Mankind shares common thoughts in every Field, and collaborative Results are Very Very Fantastic.

Let's Understand First What are Variables.

Well first let's move with the basics that we have to understand Concepts Like Constants and Variables.

A Constant is a static Value. Whereas Variable is a value that varies according to the interval of time or which interaction of a random or sample event which directly or indirectly is affecting.

We Have come so far from the world of Static and Dynamic that Now we are living in The state of Block and Node.

For some, it’s just a topic of Tech Fashion, But Every Environment needs to be specified as of its own Variables upon which it's dependent.

Let's have a quick example of Setting an environmental Variable with the Help of Tech “X”. Which Neither can Be Ignored Nor To be Left. Still Running on more than 3 Billion Devices (Mines favorites).

Steps: — — — — — — — — — — — — — — — — — — — — — — — — — — — —

  1. Locate your installation directory.
  2. Press the Windows key and search for “Environmental variables”.
  3. Now Copy Your Path up to BIN. (You can search in Your C: Directory
  4. Path Would Look Like this “C:\Program Files\Java\jdk-11.0.2\bin”.
  5. Now As we had Opened the Environmental variables window.
  6. Click on New A window will appear asking For Variable Name and Variable Value.
  7. In Variable Name type “PATH”.
  8. In variable value Type the path up to bin like in My case it “C:\Program Files\Java\jdk-11.0.2\bin”.
  9. Here we are all set now to check the Open command Prompt or CMD and Type javac . If all goes well we had our path set. and this will allow us to execute our codes from any part of the system.

An environmental variable is a type of variable whose value is set outside the Program (Can be Consider as a global variable with respect to System) through Functionality by setting the path which is through the type of system Being used.

During application initialization, these are loaded into process.env and accessed by suffixing the name of the environmental variable.

Used cases for environmental variables:-

i)Service account names

ii)domain names

iii)API URL’s

iv)Public and Private authentication Keys (only secure in server applications )

v)Group Mail Addresses.

Environmental Variables are not recommended for Every Situation. It's just like Environmental variables provide a good way to set application execution parameters that are used by processes that you do not have direct control over. However, environment variables should not be used for configuration values within your own dynamic applications.

Hence we Came to a conclusion that Environment Variables are predetermined values/set of values that are typically used to provide the ability to configure a value in your code which is outside of your application.

--

--