Object Oriented Programming: Free Will
Cogito ergo sum — René Descartes
Object Oriented programming abstracts ‘concepts’ in the language as ‘objects’. These objects have properties, akin to real world ‘things’. They exist in so far as they exist in the real world, in the mind of their creator.
Mental existence is debatable, but let’s not go there. For now, “I think therefore I am.” Hold on existentialists! Maybe later.
A class, in this context, is a blueprint or framework to create objects. A class will provide certain integral behaviour and states that an object needs to function.
An object can inherit properties from a class that it can use, to extend its implementation. An object can have its own attributes, separate from the class that it inherits properties from.
This got me thinking about something that almost always troubles me. Free will.
Does an object that inherits from a class have ‘free will’? Can it totally break away from its parent class and unchain itself from traits defined at birth? Can people break free from the genetic and behavioural framework they inherit from their ancestors or environment?
In Object Oriented Programming, we come upon a concept known as overriding. An object can override the specific implementation of its parent class and determine and present another implementation. In this case, it retains the inherited traits, but tweaks them to satisfy its own ends.
Strictly speaking, the object has no ‘free will’ per se, because the parent traits remain, indelibly etched into its character.
Are we, like objects, forever doomed to remain in the captivity of nature or can we break free, define our own attributes and leave those that we inherit behind?