Jump to content

Talk:Instance (computer science)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Merge?

[edit]

Should this (short) article be merged with Object (computer science)? Even Instantiation_(computer_science) redirects there. Yoda of Borg (talk) 02:28, 11 July 2012 (UTC)[reply]

IDK. Are object and instance synonymous? Are all objects instances and all instances objects? I suspect that many would say they are not synonymous but I suspect they are :) ... As for Instantiation_(computer_science) redirecting to Instance (computer science) what is your point? If instantiation redirected to object, then that would bolster your suggestion to merge instance with object. But as-is, instantiation==>instance is consistent with instance!=object. Stevebroshar (talk) 12:53, 23 June 2024 (UTC)[reply]

Text coherence

[edit]

Does sound sort of pedant to say "The creation of a realized instance is called instantiation"? Since, talking in terms of concepts, something realized cannot be created because it's already there? I got stuck in "realized instance". The author does not provide any relevant reference or concept attribution.
Following this last sentence author's (Margaret Rouse) "logic", I guess she wanted to refer to those realized instances is talking about. Taking a little bit care of sentece coherence and consitency, sounds better to me "The creation of an instance is an instatiation" looks logic and easy to "grasp", although in this article to me instance and instantiation are eventually the same. Otherwise make a reference like "The creation of those realized instances is an instatiation" it's kind of "correct" but intentionaly wordy and still is trying to draw from nowhere sense. Maybe the author at the attempt of explaining something to make it throught rather, is stuffing a sentence with empty bunch (of nothing).

The author reaches a very high level of abstraction with "is a specific realization of any object", instead of being "enough" conceptualized, as she chould say "is a realization of any object". It is not hard to understand then, that implicitly any object is specific in nature. Unless is an uncontrolled mass of matter, what she could instead say is that "is the realization of an (speficic) object that can be any (object)". Putting together 2 very abstract words (specific realization) in such a wide scope of possibilities makes a whole universe of misreadings.
To give another exemple of a poor thinking and terminology oversteping, by the 3rd sentence of the second paragraph, before the "dog" analogy, it's a little bit confusing to readers that are familiar with programming statements and the glossary, when the author uses the word member. A "member" is a term that already exists in the topic targeted by the author (OOP paradigm). Is an element of a class, a subset of a class, and not directly a common noun or a "superset" of an "object" that she refers to be as the class concept, resulting in a reversed containment order. As well as "specified values" could be directly misunderstood again as a programming language concept. Rather the author seeks hastly to contrast "specified values" with "variables". Neither make no differences at all when trying to take "class" into real world to compare it to computer context.

This slippery use of author's article words makes the roundup all very vague. With such a very poor aware of it the author jumbles a lot with concepts. Once wrapped up, and taking into account some audience (readers) never programmed before, one is going to see an object as a class, having no clue of what the heck "realized instance" really means, turning all into a fatal collapsing aftermath mess of ones system thinking. The superknown word and ,at the same time, specific term "Object" can be already understood by those ones had created the concept for this new programming paradigm that resembles to reality, but not for those who could not realize it has a very close relation, making a puzzle-idea of the new term. To later on come across with this article where the author self-evidence seems to hold close distance resembling between the objetcs of the real world and the paradigm one, but still does not help out much with the merging fields and general ideas.

My contribution:

For the case of class-object, I would suggest to talk of features or different shapes, colors or any aspect of any well-know thing existing in the common world. Or maybe for a strict, but well define instance, I could say that "an apple is a noun that refers any kind of apple, this refering idea of an apple is the class, the real thing is the object". For the instance concept I could say that the class is a mold (used in a factory chain process) and the instance is the production; creation of that final product. And finally for the instance-instantiation difference it could really be more useful to read his etimology. I never get to see the clear-cut of it. I may assume that instatiation is when at run-time moment the computer reads the compiled instance you typed/code/created. So by that moment any instance computation becomes an instantiation process. Nevertheless, any -ation or common noun is a bunch of things, it could also refer to all the instances you have in your program (source) code. So when you hear or utter "the instatiation of your source code have a wrong sytanx" could refer to all them together. I think many OOP programmers may use wrongly the term refering just the instance itself, or even to the declaration of an object. In the manual of C++ website, instance and object is the same. Let alone understand what is an instatiation so far...

That's all folks!

Catalunya independent! -- unknown author

TBO that comment is TL;DR. But, I did search the article for some of the words mentioned and didn't find, so I think it has been modified since this comment was written. (Thank you for teaching me a new word: pedant; didn't know the noun form. I hate to be pedantic :), but I think you should have said Does sound sort of pedantic..., or The author seems like a pedant...) Stevebroshar (talk) 12:57, 23 June 2024 (UTC)[reply]

What does this sentence even mean?

[edit]

From the article:

"An important distinction is between the data type, which is interface, and the class, which is implementation."

The sentence doesn't clearly state what this "important distinction" truly it is, nor why it's important. How is a data type an interface? An interface to what? And how is a class an implementation? An implementation of what? Why is this important in the context of the article? — Preceding unsigned comment added by Jayache80 (talkcontribs) 00:29, 21 October 2016 (UTC)[reply]

Since I don't find 'important distinction' in the article today I think someone fixed the issue. Stevebroshar (talk) 12:48, 22 June 2024 (UTC)[reply]

Some questions regarding program classes.

[edit]

We have from the article, that "Formally, 'instance' is synonymous with 'object'", and "An object is an instance of a class". Thus an object is an object of a class, an instance is an object of a class, and an instance is an instance of a class. Simply, an instance (or object) is related to a class.

Further, "The creation of an instance is called instantiation", "classes that can be instantiated are called concrete classes", and "In class-based programming, objects are created from classes by subroutines called constructors". So, at least in class-based programming, concrete classes define constructors that create class objects (instances).

Further from the article, we have that "Each time a program runs, it is an instance of that program." If we assume that a program--say x--can run, we have that x is a concrete class, that x provides an x-constructor, and that x in execution is an x-object (x-instance).

In class-based programming, when defining program x, how does one define the x-constructor? What calls the x-constructor?

In procedural programming languages generally, some procedure identifier gives the initial point of execution. For example, in 'C', 'C++', and 'C#', a procedure ("function" in the language syntax) identified as "main" gets control when the program begins to run. This procedure has a prototype. Would one say that this prototype defines an interface, and that all program classes implement this and only this interface? Is the one method on this interface also the class constructor? If not, is the constructor implied? If the constructor is implied, in this special case does the constructor necessarily call the one method on the interface?

If we have that a "concrete occurrence of an object" is necessary for an object in execution, then for the constructor for a class to be executable, the class itself must be an object. Typically, an object's constructor creates an object that has no constructor. Thus the object and the objects that in constructs differ. Where the class is a program, the object is a program object, and the program object can create instances of itself. Each new instance is itself capable of creating instances of itself. Thus each new instance must have a constructor that creates program instances. Would one say that program classes are the only classes that construct objects having constructors? 2600:100E:B141:8D37:6C95:596C:830:DDA0 (talk) 03:50, 28 December 2016 (UTC)[reply]

First, I don't think there's any _formality_ in 'instance' being synonymous with 'object'. They simply are. But, that is not your point. ... You seem to be conflating the general concept of instance with the more specific OOP context. One can say that when you run program X, it is an instance. But, it is not an OOP instance. A program is not defined as a class. It does not have a constructor. ... The C, C++, C# entry point functions each have a well-defined interface, yes. It allows the operating system to run applications in a polymorphic way. But, again, there is no program class. This program entry point interface is built-in to the language; it's not an OOP class interface. Stevebroshar (talk) 12:59, 22 June 2024 (UTC)[reply]

Instantiation disambiguation needful?

[edit]

Thanks to Mastodon I have been reintroduced to the word. I haven't the nous to parse its provenance in regard to computer science, however, although I somehow suspect that Aristotle is involved... *** kencf0618 (talk) 13:26, 30 December 2022 (UTC)[reply]

Thanks for teaching me a new word: nous. ... But, I don't have the smarts to figure out how Aristotle is involved :) Stevebroshar (talk) 13:09, 23 June 2024 (UTC)[reply]