
[計] 結構化程式設計
However, EVALUATE provides more, better options that encourage the use of structured programming.
然而,EVALUATE 提供了更多、更好的選項,鼓勵使用結構化編程。
According to structured programming, the software of the lower machine is composed by the main program, the subroutine and interrupt service routine.
按照結構化編程思想,将下位機軟件劃分為主程式、子程式和中斷程式三部分分别進行設計。
That is why there is research in software design, programming methods, structured programming and related topics.
這就是為什麼存在對軟件設計,編程方法,結構編程和相關話題的研究。
The C programming language is a general-purpose programming language that provides code efficiency, elements of structured programming, and a rich set of operators.
語言是一種通用編程語言,代碼效率較高,并提供了結構化編程元素和一組豐富的操作符。
It is a kind of structured programming language with structured control statements.
結構化語言,提供結構化控制語句。
They create abstract concepts using very structured programming languages (like PHP or Java).
他們使用一種非常結構化的語言,卻實現了很抽象的概念。
In the software design, it follows the principle of modularization and structured programming, uses C and inline assembly as the programme languages.
軟件設計采用模塊化編程和結構化編程的思想、C語言和彙編語言嵌套編程的方式。
This advance, carried out under the banner of structured programming, has led to programs that are more reliable and easier to comprehend;
這個進步是在“結構化編程”的大旗下發展起來的,盡管結果并非完美,但它讓程式變得更可靠也更易讀。
The software was designed following the principle of modularization and structured programming and using assembly as the programme languages.
在軟件方面利用彙編語言,采用模塊化編程和結構化編程。
I started programming as industry (and academia) were adopting structured programming.
我開始做編程行業(及學術編程)時采用的是結構化編程模式。
And Rexx is certainly Turing-complete, enables modules and structured programming, and has libraries for tasks such as GUI interfaces, network programming, and database access.
并且,Rexx當然是完全Turing的,支持模塊和結構化編程,有面向專門任務的庫,例如GUI接口、網絡編程和數據庫訪問。
The paper deals with the principle and structured programming of a microcomputer numerical control (MNC) system that is used on NC machining the turbine impeller with 5-dimension interpolation.
五維插補數控加工透平葉輪的微機數控(MNC)系統主要論述數控加工整體透平葉輪的微機數控系統的結構、工作原理和多維插補法。
The software of system is programmed. The Modular Structured Programming makes the program readable and modifiable.
在控制軟件設計中采用模塊化編程,增強了程式的通用性和可讀性。
This is the writer's version of structured programming and the DRY principle (Don't Repeat Yourself).
具體的方法取決于撰寫者對結構化編程和DRY(Don'tRepeatYourself,不要重複自己)原則的認識。
In this way we can solute ill-structured goal programming problem and think about priority class and the constraint values that are changing with the environment.
這樣就可以解決目标規劃中的結構不良的問題和考慮目标函數中的優先等級及右端值等隨環境變化的情況。
This course is an introduction to structured computer programming.
該課程主要介紹結構性計算機編程。
結構化編程(Structured Programming)是一種軟件開發範式,其核心思想是通過特定的控制結構來組織程式邏輯,以提升代碼的清晰度、可讀性、可維護性和可靠性。它旨在取代早期編程中過度依賴“GOTO”語句導緻的複雜、難以理解的“面條式代碼”(spaghetti code)。
其詳細含義包含以下關鍵點:
核心控制結構:結構化編程規定程式應僅由三種基本控制結構組合而成:
if-then-else
, case
/switch
)。while
, for
)。
理論上(Böhm-Jacopini定理),任何可計算函數都可以僅用這三種結構實現,無需隨意跳轉的 GOTO
語句。模塊化(Modularity):程式被分解為一系列獨立的、功能明确的子程式(如函數、過程、方法)。每個模塊應具有單一職責,并通過定義良好的接口與其他模塊交互。這促進了代碼複用和分工協作。
單入口單出口(Single Entry, Single Exit - SESE):每個控制結構(尤其是模塊)應隻有一個入口點和一個出口點。這簡化了程式流程的理解和調試,避免了因多個入口/出口導緻的複雜狀态追蹤。
避免(或限制)使用GOTO語句:雖然并非完全禁止,但結構化編程極力主張避免隨意使用 GOTO
語句進行非結構化的跳轉,因為它會破壞代碼的線性邏輯流,增加理解難度和出錯概率。複雜的控制邏輯應通過上述三種基本結構來表達。
自頂向下設計(Top-Down Design):一種常用的設計方法,從程式要解決的總體問題(頂層抽象)開始,逐步将其分解為更小、更具體的子問題(模塊),直到每個子問題都可以直接用編程語言實現。這有助于管理複雜性。
價值與影響:
結構化編程的概念主要由 Edsger W. Dijkstra 在1968年發表的著名信件《GOTO語句被認為有害》中大力推廣,并由 Corrado Böhm 和 Giuseppe Jacopini 在1966年從理論上證明其可行性(Böhm-Jacopini定理)。它已成為現代軟件開發不可或缺的基礎原則之一。
補充說明: 結構化編程主要關注程式内部的邏輯組織方式(控制流和模塊化),它與編程語言範式(如過程式、面向對象)并非同一層級的概念。過程式語言(如C、Pascal)天然支持結構化編程,而面向對象語言(如Java、C#)在其方法實現層面也廣泛應用結構化編程原則。
結構化定理的數學表達(Böhm-Jacopini定理): 任何可計算函數都可以通過組合以下三種基本控制流模式來實現: $$ begin{align} text{1. 順序:} & quad S1; S2 text{2. 選擇:} & quad text{if } C text{ then } S1 text{ else } S2 text{3. 循環:} & quad text{while } C text{ do } S end{align} $$ 其中 $S, S1, S2$ 代表語句塊,$C$ 代表條件表達式。
參考資料:
結構化編程(Structured Programming)是一種編程範式,強調通過清晰的邏輯結構和模塊化設計來提高代碼的可讀性、可維護性和可靠性。以下是其核心要點:
結構化編程主張使用三種基本控制結構組織代碼:
if-else
、switch
)實現分支邏輯。for
、while
等循環重複執行代碼塊。GOTO
語句:傳統編程依賴 GOTO
導緻代碼混亂(稱為“面條式代碼”),結構化編程用上述控制結構替代。GOTO
的濫用,成為結構化編程的理論基礎。GOTO
):10 PRINT "Enter a number: "
20 INPUT N
30 IF N < 0 THEN GOTO 60
40 PRINT "Positive"
50 GOTO 70
60 PRINT "Negative"
70 END
if-else
):n = int(input("Enter a number: "))
if n >= 0:
print("Positive")
else:
print("Negative")
結構化編程通過規範代碼組織方式,顯著提升了軟件開發效率和質量,至今仍是編程教育的基礎内容。
would you likereducedisguiseEwellin the abstractpsychiatristrepulseamalgamatingjanisPhuketpreludedWAfact of lifeleisure timepicture postcardalloantibodybethanecholdeliriadromometerfrazilgeneralshipgynoeciaheptacosanehygeianidemfactorimmunodepressioninactivatorlightgraylockwirelobelism