当前位置:网站首页>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 .
边栏推荐
- Flutter 2.10 update details
- STL container
- MATLB | multi micro grid and distributed energy trading
- 使用druid连接MySQL数据库报类型错误
- I use these six code comparison tools
- Video display and hiding of imitation tudou.com
- PowerShell: use PowerShell behind the proxy server
- Leetcode takes out the least number of magic beans
- February database ranking: how long can Oracle remain the first?
- Marubeni Baidu applet detailed configuration tutorial, approved.
猜你喜欢
JVM's responsibility - load and run bytecode
Unpool(nn.MaxUnpool2d)
How to build a technical team that will bring down the company?
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Missile interception -- UPC winter vacation training match
R语言用logistic逻辑回归和AFRIMA、ARIMA时间序列模型预测世界人口
Traditional chips and AI chips
[technology development-26]: data security of new information and communication networks
The MySQL team development specifications used by various factories are too detailed. It is recommended to collect them!
Grub 2.12 will be released this year to continue to improve boot security
随机推荐
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Exploration of short text analysis in the field of medical and health (I)
Stored procedure and stored function in Oracle
One click generation and conversion of markdown directory to word format
Tla+ through examples (XI) -- propositional logic and examples
Rabbit MQ message sending of vertx
【LeetCode】222. The number of nodes of a complete binary tree (2 mistakes)
[技术发展-26]:新型信息与通信网络的数据安全
Numpy library introductory tutorial: basic knowledge summary
[understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
PowerShell: use PowerShell behind the proxy server
openresty ngx_lua变量操作
Day_ 17 IO stream file class
Pytorch register_ Hook (operate on gradient grad)
Video display and hiding of imitation tudou.com
Unified blog writing environment
The steering wheel can be turned for one and a half turns. Is there any difference between it and two turns
Redis' hyperloglog as a powerful tool for active user statistics
Limited query of common SQL operations
Timescaledb 2.5.2 release, time series database based on PostgreSQL