In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail what are the four main principles of structured programming in computers. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
There are four main principles of structured programming: 1, from top to bottom; first, start from the top overall goal, and gradually make the problem concrete. 2. Gradual refinement; for complex problems, some sub-goals should be designed as transition and refined step by step. 3. Modularization. 4. Restrict the use of Goto statements.
Structured programming (structured programming) is the basic principle of detailed design based on module function and process design. Structured programming is a subset of procedural programming that uses logical structures for written programs, making it more effective and easier to understand and modify.
There are four main principles of structured programming:
1. Top-down: when programming, we should first consider the whole, then consider the details; first consider the global goal, then consider the local goal. Don't pursue too many details from the beginning, start with the overall goal at the top, and gradually materialize the problem.
2. Gradual refinement: for complex problems, some sub-goals should be designed as a transition and refined step by step.
3. Modularization: a complex problem must be made up of a number of simpler problems. Modularization is to decompose the overall goal of the program into sub-goals, and then further decompose it into specific small goals, each of which is called a module.
4. Restrict the use of Goto statements
The origin of structured programming method comes from the understanding and debate on GOTO statements. The affirmative conclusion is that GOTO statements are often needed at the abnormal exits of blocks and processes, and the use of Goto statements will make the program more efficient; when synthesizing program goals, GOTO statements are often useful, such as GOTO for return statements.
The negative conclusion is that GOTO statements are harmful and the scourge of program confusion, the quality of programs is inversely proportional to the number of GOTO statements, and GOTO statements should be cancelled in all high-level programming languages. After canceling the GOTO statement, the program is easy to understand, easy to debug, easy to maintain, and easy to prove its correctness. As the conclusion of the argument, in 1974 Knuth issued a convincing summary and cancelled the GOTO statement.
This is the end of the article on "what are the four main principles of structured programming in computers?". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.