DEV Community

Why are you actually using variables?

Sergiu Mureşan on August 26, 2018

When to use variables? It feels natural to instantiate a variable when needed, but we usually don't think of the reason behind it. I am presenting ...
Collapse
 
codevault profile image
Sergiu Mureşan

Sorry if it came out that way.

I made this video because I saw that many programmers were using variables haphazardly in a manner that made code overly complicated.

The video is made for the purpose of thinking more deeply when creating new variables. "How can I pass this data around?", "Oh, nevermind, I will just make a variable for it". No. That's not how you should do it.

In this video I am giving 4 valid reasons to use variables (surely there are more, but these should encompass most of the use cases).

Collapse
 
tux0r profile image
tux0r

It feels natural to instantiate a variable when needed

If the language actually supports variables, that is.

Collapse
 
codevault profile image
Sergiu Mureşan

Of course. I can't possibly be considering every single language in existence when discussing about such topics therefore I am limiting them to the top few that are being used in the industry.

Collapse
 
dhnaranjo profile image
Desmond Naranjo

What a weird reply.

It feels natural to keep your phone in your pockets.

"If your clothes have pockets, that is."

Yes. Definitely.

 
codevault profile image
Sergiu Mureşan • Edited

Sure...

  • Readability
  • Abstraction
  • Performance
  • Maintainability

I added them to the post as well.

I don't understand what is wrong with the video though. Can you explain, please?

Thread Thread
 
defman profile image
Sergey Kislyakov

There's nothing wrong with videos, some human beings just don't have enough time to watch them and prefer the transcription of the video (myself as well).

Thread Thread
 
codevault profile image
Sergiu Mureşan

Alright, I will implement a summary of the video in my posts from now on. The more people understand how important clean code is, the better.

Thanks for the feedback!