当前位置:网站首页>2022/02/13
2022/02/13
2022-07-05 02:21:00 【ekkoxxxx】
Today I saw the object-oriented analysis method , This paper compares the difference between object-oriented and process oriented programming , See an example that is easy to understand , Take Gobang for example .
Process oriented programming : The idea of programming is based on the actual process of playing chess , Start the game –> Go ahead with sunspots –> Drawing picture –> Judgement of winning or losing –> Turn white –> Drawing picture –> Judgement of winning or losing –> Go back to step two –> Output results . The process of writing a program is to realize each step layer by layer . The advantage is that performance is higher than object-oriented programming .( Because class calls need to be instantiated ,new You need to allocate memory for the object , Compare the consumption of resources ??)
object-oriented programming : It can be said that it is divided into user layer at the functional level 、 Checkerboard layer 、 Rule layer . The user layer is the black and white sides of the executive , Responsible for receiving user input , Then it goes to the chessboard layer ; The chessboard layer is responsible for drawing pictures , Then pass the chess situation to the rule layer ; The rule layer is used to judge whether the chess game continues 、 Whether any side has won , And end the game . Object oriented programming has encapsulation 、 polymorphism 、( inheritance , Forget about this ..). The advantage is relative to process oriented programming , Easy to maintain 、 Easy to expand .
边栏推荐
- Introduce reflow & repaint, and how to optimize it?
- Marubeni Baidu applet detailed configuration tutorial, approved.
- RichView TRVUnits 图像显示单位
- 179. Maximum number - sort
- Limited query of common SQL operations
- RichView TRVStyle MainRVStyle
- A tab Sina navigation bar
- The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
- Day_ 17 IO stream file class
- Interesting practice of robot programming 15- autoavoidobstacles
猜你喜欢
Security level
Codeforces Global Round 19 ABC
Practical case of SQL optimization: speed up your database
【LeetCode】110. Balanced binary tree (2 brushes of wrong questions)
A label colorful navigation bar
openresty ngx_lua執行階段
CAM Pytorch
Missile interception -- UPC winter vacation training match
LeetCode 314. Binary tree vertical order traversal - Binary Tree Series Question 6
R language uses logistic regression and afrima, ARIMA time series models to predict world population
随机推荐
The steering wheel can be turned for one and a half turns. Is there any difference between it and two turns
力扣剑指offer——二叉树篇
Summary and practice of knowledge map construction technology
Kotlin - coroutine
Li Kou Jianzhi offer -- binary tree chapter
Yolov5 model training and detection
[Yu Yue education] National Open University spring 2019 0505-22t basic nursing reference questions
Talk about the things that must be paid attention to when interviewing programmers
Some query constructors in laravel (2)
Huawei machine test question: longest continuous subsequence
Three properties that a good homomorphic encryption should satisfy
Win: add general users to the local admins group
Restful fast request 2022.2.1 release, support curl import
Win: use shadow mode to view the Desktop Session of a remote user
[机缘参悟-38]:鬼谷子-第五飞箝篇 - 警示之一:有一种杀称为“捧杀”
Leetcode takes out the least number of magic beans
openresty ngx_ Lua variable operation
How to make a cool ink screen electronic clock?
February database ranking: how long can Oracle remain the first?
[illumination du destin - 38]: Ghost Valley - chapitre 5 Flying clamp - one of the Warnings: There is a kind of killing called "hold Kill"