当前位置:网站首页>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 .
边栏推荐
- Pgadmin 4 V6.5 release, PostgreSQL open source graphical management tool
- Talk about the things that must be paid attention to when interviewing programmers
- [technology development-26]: data security of new information and communication networks
- One plus six brushes into Kali nethunter
- Rabbit MQ message sending of vertx
- 187. Repeated DNA sequence - with unordered_ Map basic content
- Talk about the things that must be paid attention to when interviewing programmers
- Official announcement! The third cloud native programming challenge is officially launched!
- RichView TRVStyle MainRVStyle
- Huawei machine test question: longest continuous subsequence
猜你喜欢

Mysql database | build master-slave instances of mysql-8.0 or above based on docker

A label colorful navigation bar

runc hang 导致 Kubernetes 节点 NotReady

Introduce reflow & repaint, and how to optimize it?

The MySQL team development specifications used by various factories are too detailed. It is recommended to collect them!

Runc hang causes the kubernetes node notready

CAM Pytorch

Restful fast request 2022.2.1 release, support curl import

Chinese natural language processing, medical, legal and other public data sets, sorting and sharing

Win: use shadow mode to view the Desktop Session of a remote user
随机推荐
丸子百度小程序详细配置教程,审核通过。
Pytorch common code snippet collection
Learn game model 3D characters, come out to find a job?
如何搭建一支搞垮公司的技术团队?
Tucson will lose more than $400million in the next year
[機緣參悟-38]:鬼穀子-第五飛箝篇 - 警示之一:有一種殺稱為“捧殺”
Can you really learn 3DMAX modeling by self-study?
spoon插入更新oracle数据库,插了一部分提示报错Assertion botch: negative time
February database ranking: how long can Oracle remain the first?
Word processing software
Pgadmin 4 V6.5 release, PostgreSQL open source graphical management tool
Comment mettre en place une équipe technique pour détruire l'entreprise?
Restful Fast Request 2022.2.1发布,支持cURL导入
Huawei machine test question: longest continuous subsequence
Kotlin - coroutine
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
【LeetCode】111. Minimum depth of binary tree (2 brushes of wrong questions)
[uc/os-iii] chapter 1.2.3.4 understanding RTOS
Learn tla+ (XII) -- functions through examples
Talk about the things that must be paid attention to when interviewing programmers