Instance variable is a fancy term for a variable that belongs to a specific object instance. It's like giving each employee their own locker to store their personal stuff, instead of one big locker that everyone has to share.
"I was debugging this legacy Java code, and it took me forever to realize they were using a static instance variable to store the database connection. No wonder the app kept crashing under load!"
"In the standup today, the new dev was going on about how they used an instance variable to store the user's session data. I had to bite my tongue to keep from suggesting they try learning what a cache is."
Martin Fowler dives into the nuances of instance variables and class variables in Ruby, and how they interact with inheritance in his article Class Instance Variable.
For a broader look at different types of domain objects, including entities with instance variables, check out Fowler's summary of Eric Evans' classifications in Evans Classification.
While not directly related to instance variables, Fowler shares a handy testing tip for catching resource leaks from connection pools and such in Testing Resource Pools. Worth a quick read.
Note: the Developer Dictionary is in Beta. Please direct feedback to skye@statsig.com.