当前位置:网站首页>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 .
边栏推荐
- Win: use PowerShell to check the strength of wireless signal
- 如何搭建一支搞垮公司的技術團隊?
- Tla+ through examples (XI) -- propositional logic and examples
- 【LeetCode】110. Balanced binary tree (2 brushes of wrong questions)
- When to catch an exception and when to throw an exception- When to catch the Exception vs When to throw the Exceptions?
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
- 【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)
- RichView TRVStyle MainRVStyle
- Timescaledb 2.5.2 release, time series database based on PostgreSQL
- Pytorch register_ Hook (operate on gradient grad)
猜你喜欢

Binary tree traversal - middle order traversal (golang)

Day_ 17 IO stream file class

Three properties that a good homomorphic encryption should satisfy

LeetCode 314. Binary tree vertical order traversal - Binary Tree Series Question 6

He was laid off.. 39 year old Ali P9, saved 150million

Codeforces Global Round 19 ABC

Li Kou Jianzhi offer -- binary tree chapter

Subject 3 how to turn on the high beam diagram? Is the high beam of section 3 up or down

Introduce reflow & repaint, and how to optimize it?

Marubeni Baidu applet detailed configuration tutorial, approved.
随机推荐
【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)
Last week's hot review (2.7-2.13)
Asynchronous and promise
Advanced conditional statements of common SQL operations
Visual explanation of Newton iteration method
Why do you understand a16z? Those who prefer Web3.0 Privacy Infrastructure: nym
Day_ 17 IO stream file class
Action News
Comment mettre en place une équipe technique pour détruire l'entreprise?
Win:将一般用户添加到 Local Admins 组中
Numpy library introductory tutorial: basic knowledge summary
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
【LeetCode】404. Sum of left leaves (2 brushes of wrong questions)
Icu4c 70 source code download and compilation (win10, vs2022)
【LeetCode】501. Mode in binary search tree (2 wrong questions)
Visual studio 2019 set transparent background (fool teaching)
Outlook:总是提示输入用户密码
Exploration of short text analysis in the field of medical and health (II)
Talk about the things that must be paid attention to when interviewing programmers
Educational Codeforces Round 122 (Rated for Div. 2) ABC