HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Programming Symbols : Instance/Instantiation

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
instanceprogramminginstantiationsymbols

Problem

Is there a generally accepted symbol for indicating instantiation. That is indicating an object is an instance of a class.

My first guess is to use a left arrow with a double or triple line but this seems more like a functional programming symbol, based upon what I've seen of Haskell.

Wikipedia has no examples and a quick google for psuedocode mostly turns up simple functional or procedural algorithms. Object Orientated examples don't seem to feature or do not use any specific symbol.

Solution

In most contexts, objects are values and classes are types, so I would simply use the colon, representing the "has type" relation:

$Object : Class$

That said, this depends on your context, and whether $:$ carries some other meaning. You could also use $\in$, since you can identify a class with the set of objects that are instances of that class.

Context

StackExchange Computer Science Q#65422, answer score: 3

Revisions (0)

No revisions yet.