Click here to Skip to main content
15,889,745 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: What is an Object Pin
PIEBALDconsult15-Nov-13 7:50
mvePIEBALDconsult15-Nov-13 7:50 
GeneralRe: What is an Object Pin
Member 1008817116-Nov-13 11:12
Member 1008817116-Nov-13 11:12 
GeneralRe: What is an Object Pin
michaelbarb16-Nov-13 14:25
michaelbarb16-Nov-13 14:25 
GeneralRe: What is an Object Pin
Member 1008817116-Nov-13 14:38
Member 1008817116-Nov-13 14:38 
GeneralRe: What is an Object Pin
michaelbarb16-Nov-13 15:32
michaelbarb16-Nov-13 15:32 
GeneralRe: What is an Object Pin
0bx17-Nov-13 2:46
0bx17-Nov-13 2:46 
GeneralRe: What is an Object Pin
irneb5-Mar-14 23:36
irneb5-Mar-14 23:36 
GeneralRe: What is an Object Pin
Marc Clifton17-Nov-13 4:51
mvaMarc Clifton17-Nov-13 4:51 
michaelbarb wrote:
Of course we have to follow there definition in that class but we are wondering what the real answer is.


Which is one of numerous complaints about education - they don't teach you how to think, they teach the wrong things, etc. How much more fruitful it is to actually explore what object, class, and instance actually mean!

So, to you question, I realized a long time ago that when writing articles and teaching OOP, there is a lot of sloppiness regarding object and class, and very few people actually even use the term "instance." So here's my definition.

A class defines a type on which operations can be performed and which also describes its relationship with other classes. Relationship is very important!

An object is an instantiation of a class. Note the use "instantiation", related of course to the word "instance", but I want to avoid the specificity of the term "instance".

I try to use the word "instance" when I refer to a specific object. We can think of objects as abstract (not the way OOP uses the term abstract) instantiations, such as a "User object". But I'll use the word "instance" when I refer to a specific, instance of an object, such as "the 'Marc Clifton' User instance."

What I have found confuses developers (both noobs and experienced devs) is when "object" is used to refer to both a class and an instance - in fact, some very smart people I know fail to make the distinction and this can lead to all sorts of design / architecture problems when they don't realize that there is a distinct difference between the definition of a class (ie a type) and its instantiation.

So, that's my 2c. Smile | :)

Marc

GeneralRe: What is an Object Pin
Member 1008817117-Nov-13 18:31
Member 1008817117-Nov-13 18:31 
GeneralRe: What is an Object Pin
Marc Clifton18-Nov-13 2:49
mvaMarc Clifton18-Nov-13 2:49 
GeneralRe: What is an Object Pin
Member 1008817118-Nov-13 6:26
Member 1008817118-Nov-13 6:26 
GeneralRe: What is an Object Pin
robocodeboy18-Nov-13 23:36
robocodeboy18-Nov-13 23:36 
GeneralRe: What is an Object Pin
Rob Grainger28-Nov-13 22:39
Rob Grainger28-Nov-13 22:39 
GeneralRe: What is an Object Pin
robocodeboy2-Dec-13 0:53
robocodeboy2-Dec-13 0:53 
GeneralRe: What is an Object Pin
Rob Grainger2-Dec-13 2:23
Rob Grainger2-Dec-13 2:23 
GeneralRe: What is an Object Pin
robocodeboy2-Dec-13 2:38
robocodeboy2-Dec-13 2:38 
GeneralRe: What is an Object Pin
Rob Grainger2-Dec-13 4:14
Rob Grainger2-Dec-13 4:14 
GeneralRe: What is an Object Pin
robocodeboy2-Dec-13 4:30
robocodeboy2-Dec-13 4:30 
GeneralRe: What is an Object Pin
michaelbarb2-Dec-13 8:11
michaelbarb2-Dec-13 8:11 
GeneralRe: What is an Object Pin
Rob Grainger28-Nov-13 4:35
Rob Grainger28-Nov-13 4:35 
GeneralRe: What is an Object Pin
michaelbarb28-Nov-13 12:55
michaelbarb28-Nov-13 12:55 
GeneralRe: What is an Object Pin
Rob Grainger28-Nov-13 22:35
Rob Grainger28-Nov-13 22:35 
GeneralRe: What is an Object Pin
michaelbarb29-Nov-13 2:40
michaelbarb29-Nov-13 2:40 
GeneralRe: What is an Object Pin
Rob Grainger2-Dec-13 2:35
Rob Grainger2-Dec-13 2:35 
GeneralRe: What is an Object Pin
michaelbarb2-Dec-13 8:00
michaelbarb2-Dec-13 8:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.