can someone confirm or correct my understanding of programming terminology?
identifier: things that programmers can choose a name for
object:(not the kotlin keyword specifically but in general) group of identifiers
member: direct child of an object
class: identifier that blueprints an object
singleton: class that can only produce a single object which is accessed as if the class IS the object
variable: identifier that stores a value
field: member variable
property: field with getter and setter
attribute: vague term, does not have a unique definition
function: identifier for which i dont find the right words to describe it
method: member function
lambda: nameless function
closure: lambda that captures it's context
m
mathew murphy
05/11/2020, 1:47 PM
An identifier is the name or label itself, not the thing labeled.
mathew murphy
05/11/2020, 1:47 PM
An object is an encapsulated data structure with associated behavior you can invoke via methods.
mathew murphy
05/11/2020, 1:48 PM
Members aren't children, they're part of the object itself.
mathew murphy
05/11/2020, 1:49 PM
A variable is a storage location which has an identifier associated with it. Technically the identifier doesn't store the value, it labels where the value is stored.
r
Ruckus
05/11/2020, 2:11 PM
Also, there is no such restriction for Singleton:
which is accessed as if the class IS the object
Many languages (such as Java) use some sort of
Class.getInstance()
m
mathew murphy
05/11/2020, 2:42 PM
Yes, in Java typically a singleton is an object when you use it, not a class you access like an object.