Object-oriented programming: Difference between revisions

Content deleted Content added
Jhadden23 (talk | contribs)
mNo edit summary
Tags: Mobile edit Mobile app edit iOS app edit App section source
Objects: another typo
Line 133:
Objects can contain other objects. This is called [[object composition]]. For example, an Employee object might have an Address object inside it, along with other information like "first_name" and "position". This type of structures shows "has-a" relationships, like "an employee has an address".
 
Some believe that OOP places too much focus on using objects rather than on [[algorithm]]s and [[data structure]]s.<ref name="stepanov"/><ref name="hickey"/> For example, programmer [[Rob Pike]] pointed out that OOP can make programmers think more about type hierarchy than composition.<ref name="RobPike">{{cite web |url=https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html |title=Less is exponentially more |last1=Pike |first1=Rob |date=25 June 2012 |access-date=1 October 2016 }}</ref> He has called object-oriented programming "the [[Roman numerals]] of computing".<ref>{{cite mailing list |last1=Pike |first1=Rob |author1-link=Rob Pike |date=2 March 2004 |url=http://groups.google.com/group/comp.os.plan9/msg/006fec195aeeff15 |title=[9fans] Re: Threads: Sewing badges of honor onto a Kernel |access-date=17 November 2016 |mailing-list=comp.os.plan9}}</ref> [[Steve Yegge]] noted that OOP makes "nouns (objects) more important "verbs" (actions), as opposed to [[functional programming]]:.<ref name="yegge">{{Cite web|url=http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html|title=Stevey's Blog Rants: Execution in the Kingdom of Nouns|access-date=20 May 2020}}</ref> [[Rich Hickey]], creator of [[Clojure]], described OOP as overly simplistic, especially when it comes to representing real-world things that change over time.<ref name="hickey">Rich Hickey, JVM Languages Summit 2009 keynote, [http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey Are We There Yet?] November 2009.</ref> [[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.<ref name="stepanov">{{Cite web| url=http://www.stlport.org/resources/StepanovUSA.html| title=STLport: An Interview with A. Stepanov| last=Stepanov| first=Alexander| access-date=21 April 2010| author-link=Alexander Stepanov}}</ref>
 
====Real-world modeling and relationships====