This book teaches you to write small programs to solve computational problems, i.e. problems for which we can compute a solution in a series of steps. The book first explains how to write computer programs in an iterative way. The program then uses iterative statements that execute the same sequence of instructions over and over again under slightly changing conditions. Hereafter, the book explains how to write recursive programs as an alternative for iterative programs. In a recursive program, a function to solve a problem invokes itself over and over again on simpler and simpler versions of the original problem. Recursive programs often lead to very concise implementations of complex algorithms.
The book uses Python as its programming language. In teaching basic programming to thousands of students, we experienced that Python is particularly suited to introduce people to the art of programming. Python is a scripting language, which makes it extremely simple to experiment with small fragments of code. The book contains about a hundred experiments to get a good grip on the different concepts of the language. Contrary to mainstream languages such as Java and C#, Python is an untyped language. As a Python programmer, you do not have to specify the kind of information that you store in variables or that you pass to functions. Typed languages such as Java and C# are definitely more difficult to learn and to use. Moreover, the benefits you get from checking typed programs only really come to the fore in larger software systems.
The book is not about Python. In fact, some of the more advanced concepts of the language are not even explained. Emphasis is on developing algorithms to solve computational problems and to implement them using mainstream concepts offered by all modern programming languages. In this way, you are able to switch to other programming languages to implement your algorithms. The book discusses the general technique of "divide and conquer" to manage the complexity of computer programs. This technique suggests to split complex functions into less complex functions, until you reach a stage in which the implementation is straightforward to work out. The book also explains more specific techniques such as backtracking and dynamic programming to solve more specific kinds of problems.
The final part of the book introduces more advanced topics in writing small programs. It first of all discusses how to reason about the correctness and the efficiency of computer programs. The book ends with an introduction to functional programming and to object-oriented programming. Functional programming offers facilities to describe solutions rather than how to compute them. There is a definite tendency to extend mainstream languages with concepts for functional programming. Object-oriented programming offers more advanced concepts such as classes to structure larger software systems.
ERIC STEEGMANS is a professor at the Department of Computer Science of the KU Leuven. He teaches courses on basic programming, on object-oriented programming and on requirements analysis in the bachelor-master programs on informatics/computer science. His students at the KU Leuven nominated him frequently as ‘best professor in computer science’.
Our customer service is happy to help. Consult our frequently asked questions or contact us.
Create an account to buy or link an Acco share and buy your books and supplies at reduced rates.
Sign up