Excerpted from "Delphi Programming University Tutorial (edited by Liu Yi, Machinery Industry Press 2005)
http://www.liu-yi.net/BBS/dispbbs.asp?boardID=6&ID=300&page=1
Computer programming is not only a theoretical course with complex concepts and wide knowledge, but also a practical course that requires hands-on action. Almost all beginner programmers dream of one day being able to roam on the computer, allowing programs to flow out continuously under the hands of typing on the keyboard, and truly becoming the master of the computer. However, after learning the programming course, when you really start writing programs, you often feel difficult to get started and at a loss. Although I studied hard and passed the exam with high scores, I could not appreciate the convenience and advantages that the knowledge I learned brought to actual programming.
Why is this happening? On the one hand, the reason is that our students do not master the general process of programming when studying and do not have an in-depth understanding of the essential laws of general programming languages. On the other hand, our teaching system is rigid, the textbooks are outdated, and the teaching ideas and content cannot keep up with the development of the times, which is out of touch with the actual situation of software development.
Computer programming language is an artificial language that realizes computer operation and control, but programming language is only a means and way of programming, not the whole of programming. Therefore, mastering the programming language does not mean that you can write excellent programs by being proficient in programming. In fact, the fields, knowledge and skills involved in programming are far beyond our imagination. Therefore, this textbook has its own different understanding of programming courses:
Programming is first and foremost a process
The programming process is usually divided into four stages: problem modeling, algorithm design, code writing, and compilation and debugging. Tasks at different stages are relatively independent and cannot be confused. Even for a relatively simple program, we should develop the habit of analyzing first, then starting, and finally debugging, and strictly follow the program design process. Because in the absence of in-depth and comprehensive analysis of the problem, writing programs in a hurry will increase the risk of failure and bring troubles of later modification and maintenance. Therefore, learning programming not only cannot avoid the programming process, but also understand and master the programming process from the perspective of the software development process and the software life cycle. From the very beginning, you must develop good habits of following programming guidelines to engage in programming design. Different from other programming textbooks, this book emphasizes the importance of programming and software development processes, and introduces readers to the basic principles and techniques of software modeling and testing. Especially considering that modern software development relies on collective cooperation and project management, it is a larger process that brings together many programming processes. Therefore, in addition to adding an introduction to the software process implementation and management in the book, how to write standardized program code is also regarded as an important section, so that readers can understand the specifications of program design at the beginning of learning programming and pay attention to the specifications of program writing when learning programming. The degree of accuracy, accuracy and capability are very important for cultivating the members of the division of labor and cooperation team needed to participate in large-scale software development in the future.
Programming is also a problem-solving method and ability
Learning programming is mainly about teaching the methods of thinking about using computers to solve problems and cultivating programming application capabilities, rather than just learning the grammatical rules of a certain programming language. Many students can figure out loops, if-else structures, and arithmetic expressions, but it is difficult to break down a programming problem into a well-structured Delphi program. This exposes the problem of focusing on grammatical details in programming teaching and ignoring the overall ideological methods and overall process implementation.
Although the development of programming theory provides many effective methods for solving problems, for beginners, learning should be the most core idea method: structured methods and object-oriented methods. To achieve this goal, we focus both structured algorithm analysis and design as the focus of textbooks, and object-oriented analysis and design as the focus. For the former, we explain commonly used structured algorithms based on three basic structures: sequential structure, selective structure and loop structure; for the latter, we focus on object-oriented abstraction, inheritance, polymorphism and encapsulation. For the latter, we focus on object-oriented abstraction, inheritance, polymorphism and encapsulation These four essential features explain the basic methods of object-oriented programming. By emphasizing basic concepts, basic methods and basic applications, we aim to lay a solid foundation for programming for beginners and establish good programming ideas. Through a large number of example analysis and demonstration of sample programming process, we strive to create a complete impression for beginners and cultivate their programming ability to grasp and solve problems from a holistic perspective.
Programming is ultimately an application to programming language
There is an interesting dialectical relationship between programming and programming language. Programming can be implemented in different programming languages, but different programming languages determine what programming ideas and methods can be used, which restricts the implementation ability and efficiency of programming. This book uses Delphi as a language for learning programming, not because Delphi has powerful visual programming functions, but because Delphi not only inherits the perfect structured style of Pascal language, but also has the real advantages of object-oriented language. What is even more gratifying is that Delphi continues to develop and constantly absorbs the essence of modern programming languages. All this makes Delphi, as a representative of modern universal programming languages, particularly suitable for teaching use. Therefore, learning the Delphi language and mastering the Delphi programming method is another important task of this course.
Although this book introduces relevant knowledge of programming language based on the Delphi language, it emphasizes some general ideas and gives up some of Delphi's strange tricks and tricks. Readers should note that different programming languages may have very different syntax and styles, but no matter which language, they are based on data (type), operations (operation), and control (logical flow) as the basic content. Going further, learning a programming language should transcend the specific expression format of the language, not stick to complicated grammatical phenomena, but stand at an abstract level, master the basic concepts of programming, and have an in-depth understanding of the essence of programming language. law. This will facilitate in-depth learning of other programming languages.