ku是什么单位| 总是心慌是什么原因| 06属什么生肖| 佝偻病是什么样子图片| 呼吸音粗是什么原因| 煮肉放什么调料| 喝什么茶去湿气| 黄色配什么颜色最搭| 2月12日什么星座| 瞒天过海是什么意思| 三伏的伏是什么意思| 耳石症是什么症状| 健康证都检查什么项目| 什么是增强ct| 巾帼不让须眉是什么意思| 车暴晒有什么影响| 缺铁性贫血吃什么药| 桂花代表什么生肖| 右脚麻是什么病的前兆| 眼视光医学是干什么的| 牙根吸收是什么意思| 冰箱什么牌子好又省电质量又好| 瘟神是什么意思| 18年属什么| 什么样的白云| 狗翻肠子什么症状| 内服什么可以美白全身| 总胆红素是什么意思| 大明湖畔的夏雨荷是什么意思| 吃绿豆有什么好处| 唐僧被封为什么佛| 乳腺增生吃什么药好| 蛟龙是什么意思| 乐话提醒业务是什么意思| 哮喘有什么症状| 芒种可以种什么菜| 视网膜病变有什么症状| 钦字五行属什么| 颈肩综合症有什么症状| 公交车是什么意思| 04年出生属什么| 手指脱皮是什么原因造成的| 撕脱性骨折什么意思| 试婚是什么意思啊| 心代表什么生肖| 印第安纹是什么| 种植牙有什么风险和后遗症| 肿气肿用什么药比较好| 什么样的笑容| 女人眉心有痣代表什么| 什么水果含维生素d| 上火了吃什么降火最快| 男女授受不亲是什么意思| 胯骨在什么位置| 人头马是什么酒| 乌鸦长什么样| 独白什么意思| 协调什么意思| 火命适合什么颜色| 本字五行属什么| 睾丸积液是什么原因造成的| 圣诞节的礼物什么时候送| 怕什么| 凌晨1点是什么时辰| 胃黏膜病变是什么意思| 力所能及什么意思| 一个木一个寿念什么| ctm是什么意思| 去化是什么意思| 七月半是什么日子| 我行我素的人什么性格| 坚果什么时候吃最好| 做梦梦到自己怀孕了是什么意思| 五更是什么生肖| 什么是灌肠| 心率是什么| 狗是什么意思| 胃疼检查什么项目| 蔓越莓是什么| 经常腰疼是什么原因女| 欧尼什么意思| hello中文是什么意思| 爷们儿大结局是什么| 丁克族是什么意思| 不吃香菜什么意思| 不爱喝水是什么原因| 屋尘螨是什么东西| 洛神花有什么功效| 什么叫世家| 夏天适合种什么蔬菜| 心脏供血不足用什么药| 婴儿拉奶瓣是什么原因| 乳腺导管局限性扩张是什么意思| 浅表性胃炎伴糜烂用什么药| 六月初六是什么日子| 双氯芬酸钠缓释片是什么药| 1026什么星座| 舌吻什么感觉| 电压mv是什么意思| 阑珊是什么意思| 嘴唇发麻是什么病兆| 女性白带发黄是什么原因| 全身水肿是什么原因引起的| 来月经前有褐色分泌物是什么原因| 茄子炒什么好吃又简单| 什么是普世价值| 不宁腿是什么症状| 孕妇流鼻血是什么原因| 望远镜什么牌子好| 飞的第一笔是什么| fat是什么意思| 彩色多普勒超声检查是什么| evian是什么品牌| 舌苔厚白用什么泡水喝| 回声增强什么意思| 地中海贫血是什么原因引起的| 漫不经心是什么意思| 肺部条索影是什么意思| 过敏涂什么药膏| 子宫内膜厚什么原因引起的| 腰肌劳损什么症状| eoa是什么意思| 为什么今年有两个六月| 琼林是什么意思| 小麦粉可以做什么| 6月28日什么星座| 浑身酸痛什么原因| 笑刑是什么| 右上腹是什么器官| 胆固醇高应注意什么| 阿弥陀佛是什么意思| 冬瓜不能和什么一起吃| 表头是什么| 难以入睡是什么原因引起的| 胎儿双顶径偏大是什么原因| 三月27号是什么星座| 电解质水是什么水| 矽肺是什么意思| 素土是什么| 7月23是什么星座| 聚什么会什么| 例假可以吃什么水果| 荷叶茶有什么功效| 阴历7月22是什么日子| 9.30号是什么星座| 黄皮肤适合什么颜色的衣服| 人为什么要洗澡| 和谐的什么| 青蛙吃什么| 补气血吃什么食物| 扬州有什么好玩的| 湿疹为什么要查肝功能| 仓鼠爱吃什么东西| 草是什么颜色的| 月经期间吃什么食物最好| 海蜇丝是什么做的| 至字五行属什么| 七月十日是什么日子| 良代表什么生肖| 中暑喝什么好| merrell是什么牌子| grp是什么意思| 煮牛肉放什么容易烂| 血管炎症状表现是什么| 生肖蛇五行属什么| 丰富是什么意思| 女人多吃什么补黄体酮| 女用避孕套是什么样的| 心脏大是什么原因| 单身为什么中指戴戒指| 阿胶适合什么人吃| 老公什么意思| 吃什么会死| 7.30是什么星座| 猪蹄和什么一起炖好吃| 大便有粘液是什么原因| 糖稀是什么| 右手中指指尖麻木是什么原因| 心火旺吃什么| 酱油色尿是什么原因| 难道是什么意思| 移交是什么意思| 为什么糙米越吃血糖越高| 排卵试纸什么时候测最准| 颈椎病挂什么科| 质子是什么| 扁豆长什么样子图片| 4.29是什么星座| 肾素低说明什么| 太作了是什么意思| 1961年属什么生肖| 女性喝什么利尿最快| 什么叫疱疹| 浮生若梦是什么意思| 再接再厉后面接什么好| 灰指甲是什么样的| 蜂蜜的主要成分是什么| 什么是心衰| 四方八面是什么生肖| 三尖瓣关闭不全是什么意思| 艮五行属什么| 维酶素片搭配什么药治萎缩性胃炎| 喊6个1是什么意思| 逝者如斯夫是什么意思| 西凤酒是什么香型| 嬉皮笑脸是什么生肖| 针灸后需要注意什么| 白手起家是什么意思| 生龙活虎是什么意思| 小腿浮肿是什么原因| 尿渗透压低是什么原因| mmf是什么药| ket是什么意思| 佛舍利到底是什么| 咖色配什么颜色好看| 女性下小腹痛挂什么科| 滴虫性阴炎有什么症状表现| 青筋暴起是什么原因| 做什么菜好吃又简单| 尿急吃什么药效果最好| 九月初四是什么星座| 日柱国印是什么意思| nm是什么单位| 手脚脱皮是什么原因导致的| 可甜可盐什么意思| 孙悟空叫什么名字| 什么是辐照食品| 秋天穿什么衣服| 头晕头重昏昏沉沉是什么原因| bpm是什么| 低压高吃什么药效果好| 光是什么| 呕吐挂什么科| 什么是正方形| 检察院是做什么的| 梦见烧衣服什么预兆| 那是什么呢| hummel是什么牌子| 办身份证需要准备什么| 耳朵嗡嗡的响是什么原因| 蝙蝠属于什么类| 钩针ch是什么意思| 苦瓜有什么好处| 石斛是什么东西| 睑腺炎是什么原因造成| 毛主席什么时候死的| 胃反酸吃什么药最好| 夫妻都是a型血孩子是什么血型| 芒果对身体有什么好处| 安宫牛黄丸适合什么人群吃| RHD血型阳性什么意思| 膝盖疼痛什么原因| 男生的鸡鸡长什么样| mu是什么单位| 甲状旁腺激素高吃什么药| 肺结核的痰是什么颜色| ins是什么| 狮子座是什么象| 云州是现在的什么地方| 脸上长癣是什么原因造成的| 拔罐红色是什么原因| 尾椎骨痛挂什么科| 唯我独尊指什么生肖| 彪是什么动物| 百度Jump to content

考研政治必考重点: 矛盾的普遍性和特殊性考研政治研究生

From Wikipedia, the free encyclopedia
百度 这份调查发现,该市有66%的用户在乡镇线下超市买过假货,其中食品占一半以上。

UML notation for a class. This Button class has variables for data, and functions. Through inheritance, a subclass can be created as a subset of the Button class. Objects are instances of a class.

Object-oriented programming (OOP) is a programming paradigm based on the object[1] – a software entity that encapsulates data and function(s). An OOP computer program consists of objects that interact with one another.[2][3] A programming language that provides OOP features is classified as an OOP language but as the set of features that contribute to OOP is contended, classifying a language as OOP and the degree to which it supports or is OOP, are debatable. As paradigms are not mutually exclusive, a language can be multi-paradigm; can be categorized as more than only OOP.

Sometimes, objects represent real-world things and processes in digital form.[4] For example, a graphics program may have objects such as circle, square, and menu. An online shopping system might have objects such as shopping cart, customer, and product. Niklaus Wirth said, "This paradigm [OOP] closely reflects the structure of systems in the real world and is therefore well suited to model complex systems with complex behavior".[5]

However, more often, objects represent abstract entities, like an open file or a unit converter. Not everyone agrees that OOP makes it easy to copy the real world exactly or that doing so is even necessary. Bob Martin suggests that because classes are software, their relationships don't match the real-world relationships they represent.[6] Bertrand Meyer argues that a program is not a model of the world but a model of some part of the world; "Reality is a cousin twice removed".[7] Steve Yegge noted that natural languages lack the OOP approach of naming a thing (object) before an action (method), as opposed to functional programming which does the reverse.[8] This can make an OOP solution more complex than one written via procedural programming.[9]

Notable languages with OOP support include Ada, ActionScript, C++, Common Lisp, C#, Dart, Eiffel, Fortran 2003, Haxe, Java,[10] JavaScript, Kotlin, Logo, MATLAB, Objective-C, Object Pascal, Perl, PHP, Python, R, Raku, Ruby, Scala, SIMSCRIPT, Simula, Smalltalk, Swift, Vala and Visual Basic (.NET).

History

[edit]

The idea of "objects" in programming began with the artificial intelligence group at Massachusetts Institute of Technology (MIT) in the late 1950s and early 1960s. Here, "object" referred to LISP atoms with identified properties (attributes).[11][12] Another early example was Sketchpad created by Ivan Sutherland at MIT in 1960–1961. In the glossary of his technical report, Sutherland defined terms like "object" and "instance" (with the class concept covered by "master" or "definition"), albeit specialized to graphical interaction.[13] Later, in 1968, AED-0, MIT's version of the ALGOL programming language, connected data structures ("plexes") and procedures, prefiguring what were later termed "messages", "methods", and "member functions".[14][15] Topics such as data abstraction and modular programming were common points of discussion at this time.

Meanwhile, in Norway, Simula was developed during the years 1961–1967.[14] Simula introduced essential object-oriented ideas, such as classes, inheritance, and dynamic binding.[16] Simula was used mainly by researchers involved with physical modelling, like the movement of ships and their content through cargo ports.[16] Simula is generally accepted as being the first language with the primary features and framework of an object-oriented language.[17]

I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning – it took a while to see how to do messaging in a programming language efficiently enough to be useful).

Alan Kay, [1]

Influenced by both MIT and Simula, Alan Kay began developing his own ideas in November 1966. He would go on to create Smalltalk, an influential OOP language. By 1967, Kay was already using the term "object-oriented programming" in conversation.[1] Although sometimes called the "father" of OOP,[18] Kay has said his ideas differ from how OOP is commonly understood, and has implied that the computer science establishment did not adopt his notion.[1] A 1976 MIT memo co-authored by Barbara Liskov lists Simula 67, CLU, and Alphard as object-oriented languages, but does not mention Smalltalk.[19]

In the 1970s, the first version of the Smalltalk programming language was developed at Xerox PARC by Alan Kay, Dan Ingalls and Adele Goldberg. Smalltalk-72 was notable for use of objects at the language level and its graphical development environment.[20] Smalltalk was a fully dynamic system, allowing users to create and modify classes as they worked.[21] Much of the theory of OOP was developed in the context of Smalltalk, for example multiple inheritance.[22]

In the late 1970s and 1980s, OOP rose to prominence. The Flavors object-oriented Lisp was developed starting 1979, introducing multiple inheritance and mixins.[23] In August 1981, Byte Magazine highlighted Smalltalk and OOP, introducing these ideas to a wide audience.[24] LOOPS, the object system for Interlisp-D, was influenced by Smalltalk and Flavors, and a paper about it was published in 1982.[25] In 1986, the first Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA) was attended by 1,000 people. This conference marked the start of efforts to consolidate Lisp object systems, eventually resulting in the Common Lisp Object System. In the 1980s, there were a few attempts to design processor architectures that included hardware support for objects in memory, but these were not successful. Examples include the Intel iAPX 432 and the Linn Smart Rekursiv.

In the mid-1980s, new object-oriented languages like Objective-C, C++, and Eiffel emerged. Objective-C was developed by Brad Cox, who had used Smalltalk at ITT Inc. Bjarne Stroustrup created C++ based on his experience using Simula for his PhD thesis.[20] Bertrand Meyer produced the first design of the Eiffel language in 1985, which focused on software quality using a design by contract approach.[26]

In the 1990s, OOP became the main way of programming, especially as more languages supported it. These included Visual FoxPro 3.0,[27][28] C++,[29] and Delphi[citation needed]. OOP became even more popular with the rise of graphical user interfaces, which used objects for buttons, menus and other elements. One well-known example is Apple's Cocoa framework, used on macOS and written in Objective-C. OOP toolkits also enhanced the popularity of event-driven programming.[citation needed]

At ETH Zürich, Niklaus Wirth and his colleagues created new approaches to OOP. Modula-2 (1978) and Oberon (1987), included a distinctive approach to object orientation, classes, and type checking across module boundaries. Inheritance is not obvious in Wirth's design since his nomenclature looks in the opposite direction: It is called type extension and the viewpoint is from the parent down to the inheritor.

Many programming languages that were initially developed before OOP was popular have been augmented with object-oriented features, including Ada, BASIC, Fortran, Pascal, and COBOL.

Features

[edit]

The OOP features provided by languages varies. Below are some common features of OOP languages.[30][31][32][33] Comparing OOP with other styles, like relational programming, is difficult because there isn't a clear, agreed-upon definition of OOP.[34]

Encapsulation

[edit]

An object encapsulates fields and methods. A field (a.k.a. attribute or property) contains information (a.k.a. state) as a variable. A method (a.k.a. function or action) defines behavior via logic code. Encapsulation is about keeping related, code together.

Information hiding

[edit]

Information hiding is organizing code so that it is accessible only to the code that needs it; not to the rest of the codebase. The internal details of an object are hidden from the outside code, allowing for changing how an object works without affecting its interface and therefore other code. Hiding information helps prevent problems when changing the code.[35] Objects act as a barrier between their internal workings and external, consuming code. Consuming code can only interact with an object via its public members.

Some programming languages, like Java, provide information hiding via visibility key words (private and public).[36] Some languages don't provide a visibility feature, but developers might follow a convention such as starting a private member name with an underscore. Intermediate levels of access also exist, such as Java's protected keyword, (which allows access from the same class and its subclasses, but not objects of a different class), and the internal keyword in C#, Swift, and Kotlin, which restricts access to files within the same module.[37]

Supporters of information hiding and data abstraction say it makes code easier to reuse and intuitively represents real-world situations.[38] [39] However, others argue that OOP does not enhance readability or modularity.[40][41] Eric S. Raymond has written that OOP languages tend to encourage thickly layered programs that destroy transparency.[42] Raymond compares this unfavourably to the approach taken with Unix and the C language.[42]

SOLID includes the open/closed principle, which says that classes and functions should be "open for extension, but closed for modification". Luca Cardelli has stated that OOP languages have "extremely poor modularity properties with respect to class extension and modification", and tend to be extremely complex.[40] The latter point is reiterated by Joe Armstrong, the principal inventor of Erlang, who is quoted as saying:[41]

The problem with object-oriented languages is they've got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.

Leo Brodie says that information hiding can lead to duplicate code,[43] which goes against the don't repeat yourself rule of software development.[44]

Composition

[edit]

Via object composition, an object can contain other objects. For example, an Employee object might contain an Address object, along with other information like name and position. Composition is a "has-a" relationships, like "an employee has an address".

Inheritance

[edit]

Inheritance be supported via the class or the prototype, which have differences but use similar terms like object and instance.

Class-based

[edit]

In class-based programming, the most common type of OOP, an object is an instance of a class. The class defines the data (variables) and methods (logic). An object is created via the constructor. Elements of class may include:

  • Class variable – belongs to the class itself; all objects of the class share one copy
  • Instance variable – belongs to an object; every object has its own version of these variables
  • Member variable – refers to both the class and instance variables of a class
  • Class method – can only use class variables
  • Instance method – belongs to an objects; can use both instance and class variables

Classes may inherit from other classes, creating a hierarchy of classes: a case of a subclass inheriting from a super-class. For example, an Employee class might inherit from a Person class which endows the Employee object with the variables from Person. The subclass may add variables and methods that do not affect the super-class. Most languages also allow the subclass to override super-class methods. Some languages support multiple inheritance, where a class can inherit from more than one class, and other languages similarly support mixins or traits. For example, a mixin called UnicodeConversionMixin might add a method unicode_to_ascii() to both a FileReader and a WebPageScraper class.

An abstract class cannot be directly instantiated as an object. It is only used as a super-class.

Other classes are utility classes which contain only class variables and methods and are not meant to be instantiated or subclassed.[45]

Prototype-based

[edit]

Instead of providing a class concept, in prototype-based programming, an object is linked to another object, called its prototype or parent. In Self, an object may have multiple or no parents,[46] but in the most popular prototype-based language, JavaScript, an object has exactly one prototype link, up to the base object whose prototype is null.

A prototype acts as a model for new objects. For example, if you have an object fruit, you can make two objects apple and orange that share traits of the fruit prototype. Prototype-based languages also allow objects to have their own unique properties, so the apple object might have an attribute sugar_content, while the orange or fruit objects do not.

No inheritance

[edit]

Some languages, like Go, don't support inheritance.[47] Instead, they encourage "composition over inheritance", where objects are built using smaller parts instead of parent-child relationships. For example, instead of inheriting from class Person, the Employee class could simply contain a Person object. This lets the Employee class control how much of Person it exposes to other parts of the program. Delegation is another language feature that can be used as an alternative to inheritance.

Programmers have different opinions on inheritance. Bjarne Stroustrup, author of C++, has stated that it is possible to do OOP without inheritance.[48] Rob Pike has criticized inheritance for creating complex hierarchies instead of simpler solutions.[49]

Inheritance and behavioral subtyping

[edit]

People often think that if one class inherits from another, it means the subclass "is a" more specific version of the original class. This presumes the program semantics are that objects from the subclass can always replace objects from the original class without problems. This concept is known as behavioral subtyping, more specifically the Liskov substitution principle.

However, this is often not true, especially in programming languages that allow mutable objects, objects that change after they are created. In fact, subtype polymorphism as enforced by the type checker in OOP languages cannot guarantee behavioral subtyping in most if not all contexts. For example, the circle-ellipse problem is notoriously difficult to handle using OOP's concept of inheritance. Behavioral subtyping is undecidable in general, so it cannot be easily implemented by a compiler. Because of this, programmers must carefully design class hierarchies to avoid mistakes that the programming language itself cannot catch.

Dynamic dispatch

[edit]

A method my be invoked via dynamic dispatch such that the method is selected at runtime instead of compile time. If the method choice depends on more than one type of object (such as other objects passed as parameters), it's called multiple dispatch.

Dynamic dispatch works together with inheritance: if an object doesn't have the requested method, it looks up to its parent class (delegation), and continues up the chain to find a matching method.

Message passing

[edit]

Message passing is when the method name and its inputs are sent like a message to the object for it to act on.

Polymorphism

[edit]

Polymorphism refers to subtyping or subtype polymorphism, where a function can work with a specific interface and thus manipulate entities of different classes in a uniform manner.[50]

For example, imagine a program has two shapes: a circle and a square. Both come from a common class called "Shape." Each shape has its own way of drawing itself. With subtype polymorphism, the program doesn't need to know the type of each shape, and can simply call the "Draw" method for each shape. The programming language runtime will ensure the correct version of the "Draw" method runs for each shape. Because the details of each shape are handled inside their own classes, this makes the code simpler and more organized, enabling strong separation of concerns.

Open recursion

[edit]

An object's methods can access the object's data. Many programming languages use a special word, like this or self, to refer to the current object. In languages that support open recursion, a method in an object can call other methods in the same object, including itself, using this special word. This allows a method in one class to call another method defined later in a subclass, a feature known as late binding.

Design patterns

[edit]

Design patterns are common solutions to problems in software design. Some design patterns are especially useful for OOP, and design patterns are typically introduced in an OOP context.

Object patterns

[edit]

The following are notable software design patterns for OOP objects.[51]

A common anti-pattern is the God object, an object that knows or does too much.

Gang of Four design patterns

[edit]

Design Patterns: Elements of Reusable Object-Oriented Software is a famous book published in 1994 by four authors: Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. People often call them the "Gang of Four". The book talks about the strengths and weaknesses of OOP and explains 23 common ways to solve programming problems.

These solutions, called "design patterns," are grouped into three types:

Object-orientation and databases

[edit]

Both OOP and relational database management systems (RDBMSs) are widely used in software today. However, relational databases don't store objects directly, which creates a challenge when using them together. This issue is called object-relational impedance mismatch.

To solve this problem, developers use different methods, but none of them are perfect.[52] One of the most common solutions is object-relational mapping (ORM), which helps connect object-oriented programs to relational databases. Examples of ORM tools include Visual FoxPro, Java Data Objects, and Ruby on Rails ActiveRecord.

Some databases, called object databases, are designed to work with OOP. However, they have not been as popular or successful as relational databases.

Date and Darwen have proposed a theoretical foundation that uses OOP as a kind of customizable type system to support RDBMSs, but it forbids objects containing pointers to other objects.[53]

Responsibility- vs. data-driven design

[edit]

In responsibility-driven design, classes are built around what they need to do and the information they share, in the form of a contract. This is different from data-driven design, where classes are built based on the data they need to store. According to Wirfs-Brock and Wilkerson, the originators of responsibility-driven design, responsibility-driven design is the better approach.[54]

SOLID and GRASP guidelines

[edit]

SOLID is a set of five rules for designing good software, created by Michael Feathers:

GRASP (General Responsibility Assignment Software Patterns) is another set of software design rules, created by Craig Larman, that helps developers assign responsibilities to different parts of a program:[55]

  • Creator Principle: allows classes create objects they closely use.
  • Information Expert Principle: assigns tasks to classes with the needed information.
  • Low Coupling Principle: reduces class dependencies to improve flexibility and maintainability.
  • High Cohesion Principle: designing classes with a single, focused responsibility.
  • Controller Principle: assigns system operations to separate classes that manage flow and interactions.
  • Polymorphism: allows different classes to be used through a common interface, promoting flexibility and reuse.
  • Pure Fabrication Principle: create helper classes to improve design, boost cohesion, and reduce coupling.

Formal semantics

[edit]

Researchers have tried to formally define the semantics of OOP. inheritance presents difficulties, particularly with the interactions between open recursion and encapsulated state. Researchers have used recursive types and co-algebraic data types to incorporate essential features of OOP.[56] Abadi and Cardelli defined several extensions of System F<: that deal with mutable objects, allowing both subtype polymorphism and parametric polymorphism (generics), and were able to formally model many OOP concepts and constructs.[57] Although far from trivial, static analysis of object-oriented programming languages such as Java is a mature field,[58] with several commercial tools.[59]

Criticism

[edit]

Some believe that OOP places too much focus on using objects rather than on algorithms and data structures.[60][61] For example, programmer Rob Pike pointed out that OOP can make programmers think more about type hierarchy than composition.[62] He has called OOP "the Roman numerals of computing".[63] Rich Hickey, creator of Clojure, described OOP as overly simplistic, especially when it comes to representing real-world things that change over time.[61] Alexander Stepanov said that OOP tries to fit everything into a single type, which can be limiting. He argued that sometimes we need multisorted algebras: families of interfaces that span multiple types, such as in generic programming. Stepanov also said that calling everything an "object" doesn't add much understanding.[60]

OOP was created to make code easier to reuse and maintain.[64] However, it was not designed to clearly show the flow of a program's instructions. That was left to the compiler. As computers began using more parallel processing and multiple threads, it became more important to understand and control how instructions flow. This is difficult to do with OOP.[65][66][67][68]

Many popular programming languages, like C++, Java, and Python, use OOP. In the past, OOP was widely accepted,[69] but recently, some programmers have criticized it and prefer functional programming instead.[70] A study by Potok et al. found no major difference in productivity between OOP and other methods.[71]

Paul Graham, a well-known computer scientist, believes big companies like OOP because it helps manage large teams of average programmers. He argues that OOP adds structure, making it harder for one person to make serious mistakes, but at the same time restrains smart programmers.[72] Eric S. Raymond, a Unix programmer and open-source software advocate, argues that OOP is not the best way to write programs.[42]

Richard Feldman says that, while OOP features helped some languages stay organized, their popularity comes from other reasons.[73] Lawrence Krubner argues that OOP doesn't offer special advantages compared to other styles, like functional programming, and can complicate coding.[74] Luca Cardelli says that OOP is slower and takes longer to compile than procedural programming.[40]

See also

[edit]

References

[edit]
  1. ^ a b c d "Dr. Alan Kay on the Meaning of "Object-Oriented Programming"". 2003. Retrieved 11 February 2010.
  2. ^ Kindler, E.; Krivy, I. (2011). "Object-Oriented Simulation of systems with sophisticated control". International Journal of General Systems. 40 (3): 313–343. doi:10.1080/03081079.2010.539975.
  3. ^ Lewis, John; Loftus, William (2008). "1.6: Object-Oriented Programming". Java Software Solutions. Foundations of Programming Design (6th ed.). Pearson Education Inc. ISBN 978-0-321-53205-3.
  4. ^ Booch, Grady (1986). Software Engineering with Ada. Addison Wesley. p. 220. ISBN 978-0-8053-0608-8. Perhaps the greatest strength of an object-oriented approach to development is that it offers a mechanism that captures a model of the real world.
  5. ^ Wirth, Niklaus (23 January 2006). "Good ideas, through the looking glass" (PDF). IEEE Computer. Cover Feature. 39 (1): 28–39. doi:10.1109/MC.2006.20. S2CID 6582369. Archived from the original (PDF) on 12 October 2016.
  6. ^ "Uncle Bob SOLID principles". YouTube. 2 August 2018.
  7. ^ Meyer 1997, p. 230.
  8. ^ Yegge, Steve (30 March 2006). "Execution in the Kingdom of Nouns". steve-yegge.blogspot.com. Retrieved 3 July 2010.
  9. ^ Boronczyk, Timothy (11 June 2009). "What's Wrong with OOP". zaemis.blogspot.com. Retrieved 3 July 2010.
  10. ^ Bloch 2018, pp. xi–xii, Foreword.
  11. ^ McCarthy, J.; Brayton, R.; Edwards, D.; Fox, P.; Hodes, L.; Luckham, D.; Maling, K.; Park, D.; Russell, S. (March 1969). "LISP I Programmers Manual" (PDF). Computation Center and Research Laboratory of Electronics. Boston, Massachusetts: Artificial Intelligence Group, M.I.T. Computation Center and Research Laboratory: 88f. Archived from the original (PDF) on 17 July 2010. In the local M.I.T. patois, association lists [of atomic symbols] are also referred to as "property lists", and atomic symbols are sometimes called "objects".
  12. ^ McCarthy, John; Abrahams, Paul W.; Edwards, Daniel J.; Hart, Swapnil D.; Levin, Michael I. (1962). LISP 1.5 Programmer's Manual. MIT Press. p. 105. ISBN 978-0-262-13011-0. Object – a synonym for atomic symbol {{cite book}}: ISBN / Date incompatibility (help)
  13. ^ Ivan E. Sutherland (May 1963). Sketchpad: a man-machine graphical communication system. AFIPS '63 (Spring): Proceedings of the May 21–23, 1963 Spring Joint Computer Conference. AFIPS Press. pp. 329–346. doi:10.1145/1461551.1461591.
  14. ^ a b Nygaard, Kristen; Dahl, Ole-Johan (1 August 1978). "The development of the SIMULA languages". ACM SIGPLAN Notices. 13 (8): 245–272. doi:10.1145/960118.808391.
  15. ^ Ross, Doug. "The first software engineering language". LCS/AI Lab Timeline. MIT Computer Science and Artificial Intelligence Laboratory. Retrieved 13 May 2010.
  16. ^ a b Holmevik, Jan Rune (Winter 1994). "Compiling Simula: A historical study of technological genesis" (PDF). IEEE Annals of the History of Computing. 16 (4): 25–37. doi:10.1109/85.329756. S2CID 18148999. Archived from the original (PDF) on 30 August 2017. Retrieved 3 March 2018.
  17. ^ Madsen, Ole Lehrman. "Kristen Nygaard". A.M. Turing Award Laureates. Retrieved 4 February 2025.
  18. ^ Butcher, Paul (30 June 2014). Seven Concurrency Models in Seven Weeks: When Threads Unravel. Pragmatic Bookshelf. p. 204. ISBN 978-1-68050-466-8.
  19. ^ Jones, Anita K.; Liskov, Barbara H. (April 1976). An Access Control Facility for Programming Languages (PDF) (Technical report). MIT. CSG Memo 137.
  20. ^ a b Bertrand Meyer (2009). Touch of Class: Learning to Program Well with Objects and Contracts. Springer Science & Business Media. p. 329. Bibcode:2009tclp.book.....M. ISBN 978-3-540-92144-8.
  21. ^ Alan C. Kay (March 1993). "The early history of Smalltalk". ACM SIGPLAN Notices. 28 (3): 69–95. doi:10.1145/155360.155364.
  22. ^ Borning, Alan Hamilton (1979). Thinglab: a constraint-oriented simulation laboratory (PDF) (Report). Stanford University.
  23. ^ Moon, David A. (June 1986). "Object-Oriented Programming with Flavors" (PDF). Conference proceedings on Object-oriented Programming Systems Languages and Applications. OOPSLA '86. pp. 1–8. doi:10.1145/28697.28698. ISBN 978-0-89791-204-4. S2CID 17150741. Retrieved 17 March 2022.
  24. ^ "Introducing the Smalltalk Zoo". CHM. 17 December 2020.
  25. ^ Bobrow, D. G.; Stefik, M. J (1982). LOOPS: data and object oriented Programming for Interlisp (PDF). European AI Conference.
  26. ^ Meyer 1997.
  27. ^ 1995 (June) Visual FoxPro 3.0, FoxPro evolves from a procedural language to an object-oriented language. Visual FoxPro 3.0 introduces a database container, seamless client/server capabilities, support for ActiveX technologies, and OLE Automation and null support. Summary of Fox releases
  28. ^ 1995 Reviewers Guide to Visual FoxPro 3.0: DFpug.de
  29. ^ Khurana, Rohit (1 November 2009). Object Oriented Programming with C++, 1E. Vikas Publishing House Pvt Limited. ISBN 978-81-259-2532-3.
  30. ^ Deborah J. Armstrong. The Quarks of Object-Oriented Development. A survey of nearly 40 years of computing literature identified several fundamental concepts found in the large majority of definitions of OOP, in descending order of popularity: Inheritance, Object, Class, Encapsulation, Method, Message Passing, Polymorphism, and Abstraction.
  31. ^ John C. Mitchell, Concepts in programming languages, Cambridge University Press, 2003, ISBN 0-521-78098-5, p.278. Lists: Dynamic dispatch, abstraction, subtype polymorphism, and inheritance.
  32. ^ Michael Lee Scott, Programming language pragmatics, Edition 2, Morgan Kaufmann, 2006, ISBN 0-12-633951-1, p. 470. Lists encapsulation, inheritance, and dynamic dispatch.
  33. ^ Pierce, Benjamin (2002). Types and Programming Languages. MIT Press. ISBN 978-0-262-16209-8., section 18.1 "What is Object-Oriented Programming?" Lists: Dynamic dispatch, encapsulation or multi-methods (multiple dispatch), subtype polymorphism, inheritance or delegation, open recursion ("this"/"self")
  34. ^ C. J. Date, Introduction to Database Systems, 6th-ed., Page 650
  35. ^ McDonough, James E. (2017). "Encapsulation". Object-Oriented Design with ABAP: A Practical Approach. Apress. doi:10.1007/978-1-4842-2838-8. ISBN 978-1-4842-2837-1 – via O'Reilly.
  36. ^ Bloch 2018, pp. 73–77, Chapter §4 Item15 Minimize the accessibility of classes and members.
  37. ^ "What is Object Oriented Programming (OOP) In Simple Words? – Software Geek Bytes". 5 January 2023. Retrieved 17 January 2023.[permanent dead link]
  38. ^ Cardelli, Luca; Wegner, Peter (10 December 1985). "On understanding types, data abstraction, and polymorphism". ACM Computing Surveys. 17 (4): 471–523. doi:10.1145/6041.6042. ISSN 0360-0300.
  39. ^ Jacobsen, Ivar; Magnus Christerson; Patrik Jonsson; Gunnar Overgaard (1992). Object Oriented Software Engineering. Addison-Wesley ACM Press. pp. 43–69. ISBN 978-0-201-54435-0.
  40. ^ a b c Cardelli, Luca (1996). "Bad Engineering Properties of Object-Oriented Languages". ACM Comput. Surv. 28 (4es): 150–es. doi:10.1145/242224.242415. ISSN 0360-0300. S2CID 12105785. Retrieved 21 April 2010.
  41. ^ a b Armstrong, Joe. Seibel, Peter (ed.). Coders at Work: Reflections on the Craft of Programming. Codersatwork.com. Archived from the original on 5 March 2010. Retrieved 13 November 2009.
  42. ^ a b c Raymond, Eric S. (2003). "The Art of Unix Programming: Unix and Object-Oriented Languages". Retrieved 6 August 2014.
  43. ^ Brodie, Leo (1984). Thinking Forth (PDF). pp. 92–93. Retrieved 4 May 2018.
  44. ^ Hunt, Andrew. "Don't Repeat Yourself". Category Extreme Programming. Retrieved 4 May 2018.
  45. ^ Bloch 2018, p. 19, Chapter §2 Item 4 Enforce noninstantiability with a private constructor.
  46. ^ Dony, C; Malenfant, J; Bardon, D (1999). "Classifying prototype-based programming languages" (PDF). Prototype-based programming: concepts, languages and applications. Singapore Berlin Heidelberg: Springer. ISBN 9789814021258.
  47. ^ "Is Go an object-oriented language?". Retrieved 13 April 2019. Although Go has types and methods and allows an object-oriented style of programming, there is no type hierarchy.
  48. ^ Stroustrup, Bjarne (2015). Object-Oriented Programming without Inheritance (Invited Talk). 29th European Conference on Object-Oriented Programming (ECOOP 2015). 1:34. doi:10.4230/LIPIcs.ECOOP.2015.1.
  49. ^ Pike, Rob (14 November 2012). "A few years ago I saw this page". Archived from the original on 14 August 2018. Retrieved 1 October 2016.
  50. ^ Stroustrup, Bjarne (19 February 2007). "Bjarne Stroustrup's C++ Glossary". polymorphism – providing a single interface to entities of different types.
  51. ^ Martin, Robert C. "Design Principles and Design Patterns" (PDF). Archived from the original (PDF) on 6 September 2015. Retrieved 28 April 2017.
  52. ^ Neward, Ted (26 June 2006). "The Vietnam of Computer Science". Interoperability Happens. Archived from the original on 4 July 2006. Retrieved 2 June 2010.
  53. ^ C. J. Date, Hugh Darwen. Foundation for Future Database Systems: The Third Manifesto (2nd Edition)
  54. ^ Wirfs-Brock, Rebecca; Wilkerson, Brian (1989). "Object-Oriented Design: A Responsibility-Driven Approach". ACM SIGPLAN Notices. 24 (10): 74. doi:10.1145/74878.74885.
  55. ^ Karsh, Patrick (19 July 2023). "GRASP Principles: Object-Oriented Design Patterns". Medium. Retrieved 30 March 2025.
  56. ^ Poll, Erik. "Subtyping and Inheritance for Categorical Datatypes" (PDF). Retrieved 5 June 2011.
  57. ^ Abadi, Martin; Cardelli, Luca (1996). A Theory of Objects. Springer-Verlag New York, Inc. ISBN 978-0-387-94775-4. Retrieved 21 April 2010.
  58. ^ Tan, Tian; Li, Yue (12 July 2023). Tai-e: A Developer-Friendly Static Analysis Framework for Java by Harnessing the Good Designs of Classics. ISSTA 2023. pp. 1093–1105. doi:10.1145/3597926.3598120.
  59. ^ Bhutani, Vikram; Toosi, Farshad Ghassemi; Buckley, Jim (1 June 2024). "Analysing the Analysers: An Investigation of Source Code Analysis Tools". Applied Computer Systems. 29 (1): 98–111. doi:10.2478/acss-2024-0013.
  60. ^ a b Stepanov, Alexander (2001–2008). "STLport: An Interview with A. Stepanov". Retrieved 21 April 2010.
  61. ^ a b Hickey, Rich (November 2009). Are We There Yet? (keynote). JVM Languages Summit.
  62. ^ Pike, Rob (25 June 2012). "Less is exponentially more". Retrieved 1 October 2016.
  63. ^ Pike, Rob (2 March 2004). "[9fans] Re: Threads: Sewing badges of honor onto a Kernel". comp.os.plan9 (Mailing list). Retrieved 17 November 2016.
  64. ^ Ambler, Scott (1 January 1998). "A Realistic Look at Object-Oriented Reuse". drdobbs.com. Retrieved 5 August 2025.
  65. ^ Shelly, Asaf (22 August 2008). "Flaws of Object Oriented Modeling". Intel Software Network. Retrieved 4 July 2010.
  66. ^ James, Justin (1 October 2007). "Multithreading is a verb not a noun". techrepublic.com. Archived from the original on 10 October 2007. Retrieved 4 July 2010.
  67. ^ Shelly, Asaf (22 August 2008). "HOW TO: Multicore Programming (Multiprocessing) Visual C++ Class Design Guidelines, Member Functions". support.microsoft.com. Retrieved 4 July 2010.
  68. ^ Robert Harper (17 April 2011). "Some thoughts on teaching FP". Existential Type Blog. Retrieved 5 December 2011.
  69. ^ Brucker, Achim D.; Wolff, Burkhart (2008). "Extensible Universes for Object-Oriented Data Models". ECOOP 2008 – Object-Oriented Programming. Lecture Notes in Computer Science. Vol. 5142. pp. 438–462. doi:10.1007/978-3-540-70592-5_19. ISBN 978-3-540-70591-8. object-oriented programming is a widely accepted programming paradigm
  70. ^ Cassel, David (21 August 2019). "Why Are So Many Developers Hating on Object-Oriented Programming?". The New Stack.
  71. ^ Potok, Thomas; Vouk, Mladen; Rindos, Andy (1999). "Productivity Analysis of Object-Oriented Software Developed in a Commercial Environment" (PDF). Software: Practice and Experience. 29 (10): 833–847. doi:10.1002/(SICI)1097-024X(199908)29:10<833::AID-SPE258>3.0.CO;2-P. S2CID 57865731. Retrieved 21 April 2010.
  72. ^ Graham, Paul. "Why ARC isn't especially Object-Oriented". PaulGraham.com. Retrieved 13 November 2009.
  73. ^ Feldman, Richard (30 September 2019). "Why Isn't Functional Programming the Norm?". YouTube.
  74. ^ Krubner, Lawrence. "Object Oriented Programming is an expensive disaster which must end". smashcompany.com. Archived from the original on 14 October 2014. Retrieved 14 October 2014.

Further reading

[edit]
[edit]
做梦梦见掉头发是什么意思 锁骨疼是什么原因 化疗吃什么补白细胞 暑湿感冒吃什么药 pku什么意思
禁欲有什么好处 什么去火 女生无缘无故头疼是什么原因 七月十五是什么节 生抽和酱油有什么区别
什么烟危害最小 放纵什么意思 旁支是什么意思 大骨头炖什么好吃 edifier是什么牌子
湖北有什么山 嫪毐是什么意思 三十七岁属什么生肖 梦见什么是受孕成功了 末梢神经炎是什么症状
什么水果对心脏好hcv8jop5ns2r.cn 梦见妯娌是什么意思jingluanji.com 亨字五行属什么hcv9jop0ns5r.cn 眉梢有痣代表什么1949doufunao.com 拔牙之后能吃什么hcv8jop9ns6r.cn
放屁特别多是什么原因hcv9jop5ns9r.cn 发烧喝什么水0297y7.com 10月29日是什么星座hcv8jop7ns5r.cn 颈椎头晕吃什么药hcv9jop1ns4r.cn 减肥喝什么hcv8jop9ns1r.cn
吃什么补红细胞最快hcv9jop4ns1r.cn 梦见火是什么预兆hcv8jop0ns0r.cn 排骨炖什么imcecn.com 尿检隐血弱阳性是什么意思hcv8jop8ns9r.cn 不打破伤风针会有什么后果hcv8jop4ns8r.cn
硒是什么意思hcv9jop6ns7r.cn 处女座属于什么星象hcv9jop4ns2r.cn 泛是什么意思hcv8jop7ns1r.cn 核磁共振挂什么科hcv8jop0ns0r.cn 野鸡大学是什么意思sanhestory.com
百度