Object vs instance difference?

Whats the difference from a instance and a object?

2 Likes

They usually refer to the same thing: an instance of a class. Because “Instance” is also the name of the root class of all classes, as well as the name of the class constructor function, it can be helpful to use “object” to avoid ambiguities.

5 Likes

Tables, userdatas, threads, and functions are all objects. Instances are userdatas, and thus are objects.

An object can refer to more than one instance (an example would be a model containing parts), while an instance is only referring to a single object. When creating an instance (Instance.new) you are only able to create one of the provided instance (given you have the permission) unless you were to clone the instance or create even more instances using Instance.new . There is not much of a difference with the two terms, however instance is more standardised than object primarily due to its nature and functionality.

Instance will create a Part, MeshPart, IntValue, etc with standard properties such as Size, Colour, Position etc.

Objects on the other hand are used primarily with Object Oriented Programming and expands the use of Instances. You will be able to create even more unique instances with custom properties. You can create a car with its max speed value, colour value and even more.

The reason why instance is standardised is because it is not expandable in nature, it will always have the same instance types used commonly by developers, unless Roblox will add a new instance type.

Objects/OOP is favoured more over instances because of its beauty and flexibility. Custom instances is always a step in making development easier.

Disclaimer:
I was typing this late at night, I may have switched things up. Please alert me if there is something wrong with my post.