1.5. More About Programs

A program is a sequence of instructions that specifies how to perform a computation. The computation might be something as complex as rendering an html page in a web browser or encoding a video and streaming it across the network. It can also be a symbolic computation, such as searching for and replacing text in a document or (strangely enough) compiling a program.

Một chương trình là một chuỗi các chỉ lệnh chỉ định làm thế nào để thực hiện tính toán. Tính toán có thể là một cái gì đó phức tạp như vẽ một trang html trong một trình duyệt web hoặc mã hóa video và truyền nó qua mạng. Nó cũng có thể là một tính toán biểu tượng, chẳng hạn như tìm kiếm và thay thế văn bản trong một tài liệu hoặc (đủ kỳ lạ) biên soạn một chương trình.
The details look different in different languages, but a few basic instructions appear in just about every language.
Những nội dung trông khác nhau trong những ngôn ngữ khác nhau, nhưng chỉ một vài chỉ dẫn căn bản xuất hiện trong mỗi ngôn ngữ
input
Get data from the keyboard, a file, or some other device.
output
Display data on the screen or send data to a file or other device.
math and logic
Perform basic mathematical operations like addition and multiplication and logical operations like andor, and not.
conditional execution
Check for certain conditions and execute the appropriate sequence of statements.
repetition
Perform some action repeatedly, usually with some variation.
Believe it or not, that’s pretty much all there is to it. Every program you’ve ever used, no matter how complicated, is made up of instructions that look more or less like these. Thus, we can describe programming as the process of breaking a large, complex task into smaller and smaller subtasks until the subtasks are simple enough to be performed with sequences of these basic instructions.

Một vài hành động lặp lại, thường với một vài biến thể.
Tin hay không thì tùy, đây thực sự là tất cả mà nó có. Mỗi chương trình bạn đã từng sử dụng, không kể nó phức tạp, đều là được làm để hướng dẫn giống hơn hoặc ngắn hơn chúng. Do đó, chúng ta có thể miêu tả chương trình như một quá trình của phá - xử lý 1 vấn đề lớn, phức tạp thành những vấn đề nhỏ hơn và nhỏ hơn nữa cho tới khi công việc đủ dễ để có thể thực hiện những hành động hướng dẫn cơ bản được lặp lại
References:

http://interactivepython.org/runestone/static/thinkcspy/index.html

Nhận xét

Bài đăng phổ biến từ blog này

2.7. Operators and Operands - toán tử và toán hạng

1.11. Formal and Natural Languages

Bài ôn tập chương 1 - Quan trọng