This is the
talk page for discussing improvements to the
Class (computer programming) article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google ( books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
Archives: 1 |
This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
|
This article cites zero (yes, zero) references. It's been around for a few years... it's about time someone got in there and added something, anything in. Jess ( talk) 03:18, 1 August 2010 (UTC) it is a logical description of an object — Preceding unsigned comment added by 210.212.56.34 ( talk) 06:52, 14 January 2012 (UTC)
"the class name is used as the name for the class" — Preceding unsigned comment added by 69.119.158.11 ( talk) 05:50, 17 September 2020 (UTC)
The whole article is nonsense. Azbookmobile ( talk) 03:50, 22 September 2022 (UTC)
The examples on this page were severely lacking in that they previously did not demonstrate why one would wish to use a class. (The PHP example is still poor, but I don't know enough about objects in PHP to fix it.)
In general, when you have multiple language examples then they should be functionally equivalent and demonstrate the property about which you are speaking. In this case, classes as a medium for data encapsulation and abstraction.
The comment about the Java example showing object instantiation is irrelevant, because both the Ruby and Lisp examples also instantiate objects. 62.253.228.193 ( talk) 08:09, 31 August 2010 (UTC)
The example given at the end of the introduction of the relationship of classes to objects is misleading, it's really talking about a type relationship between two classes. A better example might be that Jimmy Wales is an object of the class person. — Preceding unsigned comment added by Tomcrocker ( talk • contribs) 22:31, 16 October 2011 (UTC)
I came to this topic to refresh myself with the syntax of a C++ class or a Java class. I see no syntax examples. C++ has Structs but this has no syntax example. C++ has Class Interfaces but this has no syntax example. This article mentions Member accessibility but gives no C++ or C or Java syntax examples. There are several languages mentioned in this article such as C, C++, Objective-C, Python, Ruby, Java, etc but no syntax examples of any of those languages. I am not looking for a stroustrup treatise. I am looking for a syntax example to refresh my memory. I know that there are hundreds of programming languages in existence and that you cannot give examples of them all. Certainly, you can give examples for the languages that you mention in the article...without picking favorites. If you are undecided about how many then give an example for the top 5. I am sure that CNET or Dr Dobbs can assist this topic editor in determining what the top 5 programming languages are. Not all of them carry object-oriented syntax. The syntax for C AND C++ and Java are very similar. Patnclaire ( talk) 14:52, 11 April 2012 (UTC)
In the next couple of weeks, I'm planning on editing and rewriting this article for clarity, as well as finding some better sources to cite. I will also be working on some related articles, including Method, Interface, and Inheritance. If anyone has any suggestions, especially for high quality yet accessible sources that this article could cite, I would be happy to hear them. Thanks. Ben.d.zimmer ( talk) 17:04, 12 April 2012 (UTC)
I finished my first pass at overhauling this article. I editing and rewrote the article for clarity and cited sources throughout. Weasel words and uncited claims are now confined to a few particular sections, specifically the "Definitions of subclass", "Partial", "Benefits", and "Run-time representation" sections. I believe that with the exception of the "Run-time" section, these sections could be removed, but I don't want to do it myself. Thanks! Ben.d.zimmer ( talk) 15:37, 10 May 2012 (UTC)
Partial classes are over-represented in this article (long section with examples in VB.NET and Objective-C), particularly given that this is a physical (file management) issue rather than a logical (conceptual) issue. Robbiemorrison ( talk) 09:57, 28 August 2012 (UTC)
This sentence at the beginning is poorly written; "The class is instantiated into instances of itself". While many programmers might understand this, somebody new to "classes" would find it incomprehensible. The word "instantiated" needs definition somewhere. How can this be made more clear?? If there is no response after a while, I will change it. Nodekeeper ( talk) 00:34, 30 July 2013 (UTC)
From intro:
That's not the purpose of a class. Computer programmers will write a class because they want to create objects. Let's separate the formal, computer science definitions from the way OOP is actually used in the field. If anyone wants the ivory tower stuff, it can be found, but please do not clutter up the intro with hyper-geeky stuff that turns off beginners. -- Uncle Ed ( talk) 11:56, 22 October 2013 (UTC)
Currently there is a section titled "Orthogonality of the class concept and inheritance" I agree with everything in that section but I think the title is wrong. "Orthogonal" (literally at right angles to each other) in my experience means two things that may have an intersection point but are different things. That's not the case with Object-based and object-oriented. Object-based is a superset of object-oriented (all object-oriented languages are object-based but some are only object-based and not object-oriented, e.g. Visualbasic). MadScientistX11 ( talk) 03:56, 16 December 2013 (UTC)
That section currently starts out like this: "Conceptually, a superclass should be considered as a common part of its subclasses. " I usually don't make that big a deal about language but that is really expressed poorly and is either hard to understand at best or fundamentally wrong about what a class is at worst. A superclass is not a part of its subclass. Words like "part" and "kind" have specific meanings in OO and a subclass is a kind of its superclass but not a part of it. Vehicle could be a superclass with truck and car as subclasses but it would be a conceptual error (which unfortunately is a common error among new and even not so new OO developers) to model the bill of materials as a subclass. I.e., a car is also a body, engine, tires, etc. but those aren't subclasses of car they are parts of it and are modeled as object properties. Anyway, I'm going into too much detail it's just such a fundamental error I was surprised to see it here but I'm going to change it and add some references. I've also seen other sections in this article that aren't clear on the distinction between subparts and subclasses and I plan to edit those as well. MadScientistX11 ( talk) 20:11, 20 December 2013 (UTC)
Can't see justification for independent article for "Open class". a couple of sentences in this article would suffice. Polyamorph ( talk) 20:25, 16 May 2018 (UTC)
It says: a class is an extensible program-code-template for creating objects. Isn't that a retarded way, using too many words? Of course it's extensible and do we have to say "program-code-template"? Isn't it good enough to say it's a "template for creating objects"? Why do you have to be so anal about it? — Preceding unsigned comment added by 88.95.4.170 ( talk) 10:00, 9 August 2020 (UTC)
@ Meownium
WRT short desc: Specification of [a] object structure That is not correct (enough) IMO. An object is both structure and functionality. Therefore a class must specify both. Previously, I changed the desc to specifies an object so that it covers both ... all aspects of an object. If we _must_ mention structure ... then we should also mention functionality. I think it was fine before. It either needs to also mention functionality or to not mention structure.
You shoved unrelated sentences together to make a run-on paragraph. I know that WP articles (all writing for that matter) are not suppose to have lots of short paragraphs, but it's better to have short paragraphs than run-on paragraphs IMO.
A paragraph should have one idea. As-is, the first paragraph has 4: Definition, creation, members and inheritance.
For reference: In object-oriented programming, a class defines the structure, initial state and behavior of an object. An object is created through a process known as instantiation, the creation of an instance of a class. Classes may define members, such as methods and variables, that are local to either the class itself or instances of that class. If the programming language supports inheritance, a class is extensible by allowing the definition of one class to be based on and extended from another. Stevebroshar ( talk) 13:56, 28 June 2024 (UTC)
This is the
talk page for discussing improvements to the
Class (computer programming) article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google ( books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
Archives: 1 |
This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
|
This article cites zero (yes, zero) references. It's been around for a few years... it's about time someone got in there and added something, anything in. Jess ( talk) 03:18, 1 August 2010 (UTC) it is a logical description of an object — Preceding unsigned comment added by 210.212.56.34 ( talk) 06:52, 14 January 2012 (UTC)
"the class name is used as the name for the class" — Preceding unsigned comment added by 69.119.158.11 ( talk) 05:50, 17 September 2020 (UTC)
The whole article is nonsense. Azbookmobile ( talk) 03:50, 22 September 2022 (UTC)
The examples on this page were severely lacking in that they previously did not demonstrate why one would wish to use a class. (The PHP example is still poor, but I don't know enough about objects in PHP to fix it.)
In general, when you have multiple language examples then they should be functionally equivalent and demonstrate the property about which you are speaking. In this case, classes as a medium for data encapsulation and abstraction.
The comment about the Java example showing object instantiation is irrelevant, because both the Ruby and Lisp examples also instantiate objects. 62.253.228.193 ( talk) 08:09, 31 August 2010 (UTC)
The example given at the end of the introduction of the relationship of classes to objects is misleading, it's really talking about a type relationship between two classes. A better example might be that Jimmy Wales is an object of the class person. — Preceding unsigned comment added by Tomcrocker ( talk • contribs) 22:31, 16 October 2011 (UTC)
I came to this topic to refresh myself with the syntax of a C++ class or a Java class. I see no syntax examples. C++ has Structs but this has no syntax example. C++ has Class Interfaces but this has no syntax example. This article mentions Member accessibility but gives no C++ or C or Java syntax examples. There are several languages mentioned in this article such as C, C++, Objective-C, Python, Ruby, Java, etc but no syntax examples of any of those languages. I am not looking for a stroustrup treatise. I am looking for a syntax example to refresh my memory. I know that there are hundreds of programming languages in existence and that you cannot give examples of them all. Certainly, you can give examples for the languages that you mention in the article...without picking favorites. If you are undecided about how many then give an example for the top 5. I am sure that CNET or Dr Dobbs can assist this topic editor in determining what the top 5 programming languages are. Not all of them carry object-oriented syntax. The syntax for C AND C++ and Java are very similar. Patnclaire ( talk) 14:52, 11 April 2012 (UTC)
In the next couple of weeks, I'm planning on editing and rewriting this article for clarity, as well as finding some better sources to cite. I will also be working on some related articles, including Method, Interface, and Inheritance. If anyone has any suggestions, especially for high quality yet accessible sources that this article could cite, I would be happy to hear them. Thanks. Ben.d.zimmer ( talk) 17:04, 12 April 2012 (UTC)
I finished my first pass at overhauling this article. I editing and rewrote the article for clarity and cited sources throughout. Weasel words and uncited claims are now confined to a few particular sections, specifically the "Definitions of subclass", "Partial", "Benefits", and "Run-time representation" sections. I believe that with the exception of the "Run-time" section, these sections could be removed, but I don't want to do it myself. Thanks! Ben.d.zimmer ( talk) 15:37, 10 May 2012 (UTC)
Partial classes are over-represented in this article (long section with examples in VB.NET and Objective-C), particularly given that this is a physical (file management) issue rather than a logical (conceptual) issue. Robbiemorrison ( talk) 09:57, 28 August 2012 (UTC)
This sentence at the beginning is poorly written; "The class is instantiated into instances of itself". While many programmers might understand this, somebody new to "classes" would find it incomprehensible. The word "instantiated" needs definition somewhere. How can this be made more clear?? If there is no response after a while, I will change it. Nodekeeper ( talk) 00:34, 30 July 2013 (UTC)
From intro:
That's not the purpose of a class. Computer programmers will write a class because they want to create objects. Let's separate the formal, computer science definitions from the way OOP is actually used in the field. If anyone wants the ivory tower stuff, it can be found, but please do not clutter up the intro with hyper-geeky stuff that turns off beginners. -- Uncle Ed ( talk) 11:56, 22 October 2013 (UTC)
Currently there is a section titled "Orthogonality of the class concept and inheritance" I agree with everything in that section but I think the title is wrong. "Orthogonal" (literally at right angles to each other) in my experience means two things that may have an intersection point but are different things. That's not the case with Object-based and object-oriented. Object-based is a superset of object-oriented (all object-oriented languages are object-based but some are only object-based and not object-oriented, e.g. Visualbasic). MadScientistX11 ( talk) 03:56, 16 December 2013 (UTC)
That section currently starts out like this: "Conceptually, a superclass should be considered as a common part of its subclasses. " I usually don't make that big a deal about language but that is really expressed poorly and is either hard to understand at best or fundamentally wrong about what a class is at worst. A superclass is not a part of its subclass. Words like "part" and "kind" have specific meanings in OO and a subclass is a kind of its superclass but not a part of it. Vehicle could be a superclass with truck and car as subclasses but it would be a conceptual error (which unfortunately is a common error among new and even not so new OO developers) to model the bill of materials as a subclass. I.e., a car is also a body, engine, tires, etc. but those aren't subclasses of car they are parts of it and are modeled as object properties. Anyway, I'm going into too much detail it's just such a fundamental error I was surprised to see it here but I'm going to change it and add some references. I've also seen other sections in this article that aren't clear on the distinction between subparts and subclasses and I plan to edit those as well. MadScientistX11 ( talk) 20:11, 20 December 2013 (UTC)
Can't see justification for independent article for "Open class". a couple of sentences in this article would suffice. Polyamorph ( talk) 20:25, 16 May 2018 (UTC)
It says: a class is an extensible program-code-template for creating objects. Isn't that a retarded way, using too many words? Of course it's extensible and do we have to say "program-code-template"? Isn't it good enough to say it's a "template for creating objects"? Why do you have to be so anal about it? — Preceding unsigned comment added by 88.95.4.170 ( talk) 10:00, 9 August 2020 (UTC)
@ Meownium
WRT short desc: Specification of [a] object structure That is not correct (enough) IMO. An object is both structure and functionality. Therefore a class must specify both. Previously, I changed the desc to specifies an object so that it covers both ... all aspects of an object. If we _must_ mention structure ... then we should also mention functionality. I think it was fine before. It either needs to also mention functionality or to not mention structure.
You shoved unrelated sentences together to make a run-on paragraph. I know that WP articles (all writing for that matter) are not suppose to have lots of short paragraphs, but it's better to have short paragraphs than run-on paragraphs IMO.
A paragraph should have one idea. As-is, the first paragraph has 4: Definition, creation, members and inheritance.
For reference: In object-oriented programming, a class defines the structure, initial state and behavior of an object. An object is created through a process known as instantiation, the creation of an instance of a class. Classes may define members, such as methods and variables, that are local to either the class itself or instances of that class. If the programming language supports inheritance, a class is extensible by allowing the definition of one class to be based on and extended from another. Stevebroshar ( talk) 13:56, 28 June 2024 (UTC)