What Is Imperative Programming?
Imperative programming is a programming paradigm that describes the behavior a computer needs to do. Almost all computer hardware work is imperative; almost all computer hardware is designed to run machine code, written in an imperative style. Higher-level imperative programming languages use variables and more complex statements, but still follow the same paradigm. Although not a computer program, it has a similar style to imperative programming: each step is an instruction, and the tangible world controls the situation. Because the basic concepts of imperative programming are not only conceptually familiar, but also easily embodied in hardware, most programming languages are imperative.
- Most of the
- Procedural programming is an imperative programming in which a program is built from one or more procedures (also called subroutines or functions). These terms are often used as synonyms, but the use of programs has a huge impact on the emergence of imperative programs and how they are constructed. Heavy procedural programming is a form of structured programming where state changes are localized to the process or are limited to explicit parameters and return from the process. Since the 1960s, structured programming and modular programming have generally been promoted as techniques to improve the maintainability and overall quality of imperative programs. The concept behind object-oriented programming attempts to extend this approach.
- Programmatic programming can be seen as a step towards declarative programming. Programmers can usually determine what a particular procedure should do simply by looking at the name, parameters, and return type of the procedure (and related comments) without having to look at the details of how it achieves its results. At the same time, a complete program is still necessary because it largely repairs the statements to be executed and their execution order.
- The earliest imperative language was the machine language of the original computer. In these languages, instructions are very simple, which makes hardware implementation easier, but prevents the creation of complex programs. FORTRAN was developed by International Business Machines Corporation (IBM), which John Backus started in 1954, and is the first major programming language to remove the obstacles caused by machine code when creating complex programs. FORTRAN is a compiled language that allows named variables, complex expressions, subroutines, and many other features common in imperative languages. Over the next 20 years, many other major high-level imperative programming languages were developed. In the late 1950s and 1960s, ALGOL was developed to make mathematical algorithms easier to express and even serve as a target language for operating systems of some computers. MUMPS (1966) brought the imperative paradigm to the logical extreme, without any statement at all, completely dependent on the command, and even made the IF and ELSE commands independent of each other, and can only be connected through an internal variable named $. test. Both COBOL (1960) and BASIC (1964) tried to make programming syntax look more like English. In the 1970s, Pascal was developed by Niklaus Wirth and C was created by Dennis Ritchie while working at Bell Labs. Wirth went on to design Modula-2 and Oberon. To meet the needs of the US Department of Defense, a team of Jean Ichbiah and Honeywell began designing Ada in 1978 after experiencing a four-year project definition language requirement. The specification was first published in 1983 and revised in 1995, 2005 and 2012 [1] .
- In the 1980s, interest in object-oriented programming grew rapidly. These languages are imperative in style, but add support for objects. The last two decades of the 20th century saw the development of many such languages. Smalltalk-80 was originally conceived by Alan Kay in 1969 and released in 1980 by Xerox Palo Alto Research Center (PARC). Learning from another object-oriented language concept-Simula (considered as the world's first object-oriented programming language, developed in the 1960s)-Bjarne Stroustrup designed C ++, a C-based language The design of the object-oriented language .C ++ was first implemented in 1979 and completed in 1983. In the late 1980s and 1990s, the famous imperative language based on object-oriented concepts was Perl, released by Larry Wall in 1987; Python, released by Guido van Rossum in 1990; Visual Basic and Visual C ++ ( Including Microsoft Foundation Class Library (MFC) 2.0), released by Microsoft in 1991 and 1993 respectively; PHP, released by Rasmus Lerdorf in 1994; Java released by Sun Microsystems in 1995; JavaScript released by Brendan Eich (Netscape) Ruby was released in 1995 by Yukihiro "Matz" Matsumoto. Microsoft's .NET Framework (2002) is essential at its core, and its main content is also the target language, VB.NET and C # running on it; but Microsoft's F #, a functional language, is also on it run.