are unused variables are bad thing?

if i will use variable and leave them (not taking any work from them) can it lead to some serious problem like slow down of program or exploits or something like that.
Last edited on
exploits? no. All it will do is make your program use more memory.

This could lead to slow down, but it depends on how much memory you're talking. If you're just talking about a handful of ints, then it's nothing.
Letting variables live throughout large scopes also pollutes that scope with named identifiers. It could lead to ambiguity, mistaken use of a variable that hides another, etc..
And it begs the question why the hell those variables are even there if you're not gonna use them anyways.

And it begs the question why the hell those variables are even there if you're not gonna use them anyways.

i was just curious.
Topic archived. No new replies allowed.