<div><span style="font-size:15px;"><span style="font-size:12px;"><b><i>In the August edition of Byte magazine in 1981, David Robson opens his article, which became the introduction of ‘</i></b></span></span><span style="font-size:12px;"><b><i>-Oriented Software Systems</i></b></span><span style="font-size:12px;"><b><i>’ for many, by admitting up front that it is a departure from what many familiar with imperative, top-down programming are used to. </i></b></span> </div><div><span style="font-size:12px;"><b><i>“Many people who have no idea how a computer works find the idea of -oriented programming quite natural. In contrast, many people who have experience with computers initially think there is something strange about oriented systems.”</i></b></span> </div><div><span style="font-size:12px;"><b><i>It is fair to say that, generations later, the idea of organizing your code into larger meaningful </i></b></span><i><span style="font-size:12px;"><b><i>s</i></b></span></i><span style="font-size:12px;"><b><i> that model the parts of your problem continues to puzzle programmers. If they are used to top-down programming or functional programming, which treats elements of code as precise mathematical functions, it takes some getting used to. After an initial hype period had promised improvements for modularising and organising large codebases, the idea was over applied. With OOP being followed by OOA (-oriented analysis) and OOD (-oriented design) it soon felt like everything you did in software </i></b></span><span style="font-size:12px;"><b><i>had to be broken down to s and their relationships</i></b></span><span style="font-size:12px;"><b><i> to each other. Then the critics arrived on the scene, some of them quite disappointed. </i></b></span> </div><div><span style="font-size:12px;"><b><i>Some </i></b></span><span style="font-size:12px;"><b><i>claimed</i></b></span><span style="font-size:12px;"><b><i> that under OOP writing tests is harder and it requires extra care to </i></b></span><span style="font-size:12px;"><b><i>refactor</i></b></span><span style="font-size:12px;"><b><i>. There is the overhead when reusing code that the creator of Erlang famously described as a case when </i></b></span><span style="font-size:12px;"><b><i>you wanted a banana but you got a gorilla holding the banana</i></b></span><span style="font-size:12px;"><b><i>. Everything comes with an implicit, inescapable environment. </i></b></span> </div><div><span style="font-size:12px;"><b><i>Other ways of </i></b></span><span style="font-size:12px;"><b><i>describing</i></b></span><span style="font-size:12px;"><b><i> this new way of solving problems include the analogy between an imperative programmer as “a cook or a chemist, following recipes and formulas to achieve a desired result” and the oriented programmer as “a greek philosopher or 19th century naturalist concerned with the proper taxonomy and deion of the creatures and places of the programming world.” </i></b></span> </div><br /><div><b><span style="font-size:1.3em;"><b><span style="font-size:12px;"><b><i>Was the success just a coincidence? </i></b></span></b></span></b> </div><br /><div><span style="font-size:12px;"><b><i>OOP is still one of the dominant paradigms right now. But that might be due to the success of languages who happen to be OOP. Java, C++ and Kotlin rule mobile for Android and Swift and ive-C for iOS so you can’t develop software for mobile unless you understand the -oriented approach. For the web, it’s , Python, PHP and Ruby.</i></b></span> </div><div><span style="font-size:12px;"><b><i>Asking why so many widely-used languages are OOP might be mixing up cause and effect. Richard Feldman argues in his </i></b></span><span style="font-size:12px;"><b><i>talk</i></b></span><span style="font-size:12px;"><b><i> that it might just be coincidence. C++ was developed in the early 1980s by </i></b></span><span style="font-size:12px;"><b><i>Bjarne Stroustrup</i></b></span><span style="font-size:12px;"><b><i>, initially as a set of extensions to the C programming language. Building on C , C++ added orientation but Feldman argues it became popular for the overall upgrade from C including type-safety and added support for automatic resource management, generic programming, and exception handling, among other features. </i></b></span> </div><div><span style="font-size:12px;"><b><i>Then Java wanted to appeal to C++ programmers and doubled down on the OOP part. Ultimately, Sun Microsystems wanted to repeat the C++ trick by aiming for greatest familiarity for developers adopting Java. </i></b></span> </div><div><span style="font-size:12px;"><b><i>Millions of developers quickly moved to Java due to its exclusive integration in web browsers at the time. Seen this way, OOP seems to just be hitching a ride, rather than driving the success.</i></b></span> </div><br /><br /><div><b><span style="font-size:1.3em;"><b><span style="font-size:12px;"><b><i>What can OOP do that is unique to it?</i></b></span></b></span></b> </div><br /><div><span style="font-size:12px;"><b><i>There are some valuable aspects to OOP, some of which keep it omnipresent even when it has its drawbacks. Let’s look at the cornerstones of OOP.</i></b></span> </div><div><b><span style="font-size:12px;"><b><i>Encapsulation</i></b></span></b><span style="font-size:12px;"><b><i>. This means that data is generally hidden from other parts of a language—placed in a capsule, if you will. OOP encapsulates data by default; s contain both the data and the methods that affect that data, and good OOP practice means you provide getter and setter methods to control access to that data. This protects mutable data from being changed willy nilly, and makes application data safer. </i></b></span> </div><div><span style="font-size:12px;"><b><i>Supposedly, it is one of the greatest benefits of OOP. Even though it is most commonly associated with -oriented programming, the concept itself is in fact </i></b></span><span style="font-size:12px;"><b><i>separate</i></b></span><span style="font-size:12px;"><b><i> from it and can be implemented without using s. </i></b></span><span style="font-size:12px;"><b><i>Abstraction is a complementary concept</i></b></span><span style="font-size:12px;"><b><i> to encapsulation here; where encapsulation hides internal information, abstraction provides an easier-to-use public interface to data. In any case, it is not uniquely a OOP feature and can be done with modules isolating a system function or a set of data and operations on those data within a module.</i></b></span> </div><div><b><span style="font-size:12px;"><b><i>Inheritance</i></b></span></b><span style="font-size:12px;"><b><i>. Because s can be created as subtypes of other s, they can inherit variables and methods from those s. This allows s to support operations defined by anterior types without having to provide their own definition. The goal is to not repeat yourself—multiple uses of the same code is hard to maintain. But functional programming can also achieve DRY through reusable functions. Same goes for memory efficiency. Even though inheritance does contribute to that, so does the </i></b></span><span style="font-size:12px;"><b><i>concept of closures in FP. </i></b></span> </div><div><span style="font-size:12px;"><b><i>While inheritance is a OOP specific idea, some argue its benefits can be better achieved by </i></b></span><span style="font-size:12px;"><b><i>composition</i></b></span><span style="font-size:12px;"><b><i>. </i></b></span><span style="font-size:12px;"><b><i>If you lose inheritance</i></b></span><span style="font-size:12px;"><b><i>, s and methods quickly dissolve as the syntactic sugar for structs and procedures they are. Note that: Inheritance is also necessary to allow polymorphism, which we discuss below.</i></b></span> </div><div><b><span style="font-size:12px;"><b><i>Polymorphism. </i></b></span></b><span style="font-size:12px;"><b><i>Literally, shape-changing, this concept allows one or method, whether it’s a generic, an interface, or a regular , to serve as the template for other s and methods. There are many forms of </i></b></span><span style="font-size:12px;"><b><i>polymorphism</i></b></span><span style="font-size:12px;"><b><i>. A single function can be overloaded, shape-shift and adapt to whichever class it’s in. oriented programming tends to use a lot of subtyping polymorphism and ad-hoc polymorphism, but again, this is not a concept limited to OOP. </i></b></span> </div><div><span style="font-size:12px;"><b><i>Seems like in 2020, there is not so much that OOP can do that other programming paradigms cannot, and a good programmer </i></b></span><span style="font-size:12px;"><b><i>will use strategies from multiple paradigms together in the battle against complexity.</i></b></span><span style="font-size:12px;"><b><i> For example, if you look at the tags most often appearing in relation to a question tagged under </i></b></span><span style="font-size:12px;"><b><i>OOP</i></b></span><span style="font-size:12px;"><b><i> vs </i></b></span><span style="font-size:12px;"><b><i>functional programming</i></b></span><span style="font-size:12px;"><b><i>, pops up in both. </i></b></span> </div><br /><div><b><span style="font-size:1.3em;"><b><span style="font-size:12px;"><b><i>What’s to come?</i></b></span></b></span></b> </div><br /><div><span style="font-size:12px;"><b><i>OOP has, however, been wildly successful. It may be that this success is a consequence of a massive industry that supports and is supported by OOP.</i></b></span> </div><div><span style="font-size:12px;"><b><i>So what about the developers themselves? Our Developer Survey this year shows that they are gaining more and more </i></b></span><span style="font-size:12px;"><b><i>purchasing influence.</i></b></span><span style="font-size:12px;"><b><i> Well, if we also look at what developers prefer to work with, Haskell and Scala are among the most </i></b></span><span style="font-size:12px;"><b><i>loved</i></b></span><span style="font-size:12px;"><b><i> programming languages. Scala gets you the second highest </i></b></span><span style="font-size:12px;"><b><i>salary</i></b></span><span style="font-size:12px;"><b><i>. So maybe with more FP evangelism, they will climb the </i></b></span><span style="font-size:12px;"><b><i>list</i></b></span><span style="font-size:12px;"><b><i> of most popular languages, too.</i></b></span> </div><div><span style="font-size:12px;"><b><i>There is some movement though, big companies like Twitter are running their backend almost entirely on Scala code. Facebook who has been recently applying Haskell and many of the major OOP languages are also adopting functional features. .NET has LINQ and Java 8 introduced Lambdas. is increasingly functional despite the introduction of classes in ES6. Swift may be the happy medium between an -oriented and a functional language. So maybe there’s no need to choose: you can have your class Cake and EatCake() it too. </i></b></span> </div><br />
In the August edition of Byte magazine
경영공부(ceonim)
2021-08-13 18:11
추천 0
다른 게시글
-
니혼 가고싶다 [3]익명(reasonor) | 21.08.13추천 0
-
당근 씨발 근본없는 도둑놈 사기꾼 양산 사이트 [1]익명(116.126) | 21.08.13추천 0
-
정처기 나올꺼 찝어줘 [1]익명(218.38) | 21.08.13추천 0
-
뒤로대 ㅋㅋㅋㅋㅋ코딩낭인(58.236) | 21.08.13추천 0
-
루비 씨발 왜구 새끼가 처 만들었단거부터 기분이 쌔했는데 [2]익명(116.126) | 21.08.13추천 0
-
Crazy Korean Guy Breaks His Window While만남의광장(aerohong) | 21.08.13추천 0
-
역시 잘해주는건 좀 지켜본 뒤에 해야 하더라 [4]익명(77.111) | 21.08.13추천 0
-
방산업체에서 레이다 만들고 싶음 [10]익명(175.198) | 21.08.13추천 0
-
사실 제주대 컴공이 제일 좋다 [5]익명(1.249) | 21.08.13추천 0
-
고졸인데 자격증도 없으면 뭐먹고사냐 그런애들 한둘이 아니던데 ㅋㅋ [4]익명(121.163) | 21.08.13추천 0
댓글 0