PREFACE
Introduction
Nowadays,learning a programming language becomes essential to the engineering or science education,as computation is at the core of all modern engineering and science disciplines.Furthermore,as we also believe in the Digital Technology and AI Era,we postulate that“Nowadays,learning a programming language becomes essential to ALL THE STUDENT,even kids”.Empowered with programming skills,students will also improve unique and es-sential problem-solving strategies which are easily transferable to other endeavors.This book approaches a student-centered C programming teaching and learning,by radically deviating from the classical introductory programming book’ organization,writing and content commu-nication as a tutorial.Instead,it covers C language programming how and what as well as the entire life cycle of a C program based on real details of implementation and application,while promoting and mastering debugging skills as the driver or enabler of the C programming pro-cess.Leveraging the debugging process at the core of the C programming learning and teach-ing process will avoid costly future maintenance issues alongside learning autonomy.Mainly,it promotes learners’ attitude and spirit towards lifelong learning through learning by doing,as well as by discovering and exploring the how of C language by themselves.
Goals and Audience
C was chosen for the introduction to the programming process because it is a procedural pro-gramming language and also because we believe engineering and scientific problem-solving is inherently procedural.Additionally,there are several other reasons to choose C as the first programming language such as:(1)to master object-oriented programming concepts students should know first elementary programming concepts,(2)C++,Java and C# share in some way,foundational concepts and syntax of C,(3)C is unbeatable in terms of performance when compared with other high-level programming languages,and(4)major parts of the operating systems like Windows and Linux,including their device drivers are written in C.This book is written for students with no previous programming experience(i.e.,it is intended as a first course in computer programming)and it follows an active and balanced teaching and learning approach for the theory and practice of programming language.It leads students in a holistic manner to ever-improving programming skills based on hands-on experiences and understand-ing the C programming environment and tools,while avoiding procrastination,enhancing learning autonomy or self-study at the maximum amount of enjoyment.
Our Teaching and Learning Approach
To really empower students with problem-solving and programming skills needed in their future workplace,their learning attitudes and spirit towards motivation,excitement,self-study and resilience,must be presented and enhanced in and after each class alongside hands-on activities.That is,computer programming is not an innate skill,and so,to really become comfortable with the mechanical process of writing and debugging code,students need to practice solving problems and writing code,while simultaneously being willing to learn,not afraid of failing and resilient enough to never give up.
Therefore,a teaching strategy against passive reading should be fostered by teaching not only the concepts of the C language but also the entire life cycle of a C program,while discovering and ex-ploring the how of the main C concepts.All classes from the day one,should be based on hands-on experiences,starting first with demonstratives examples followed by exploration and discovering of the mechanism of main C concepts,as well as pinpointing and fixing program bugs.Incentives for active participation in and out of classes(e.g.,doing homework and classroom discussions)should be promoted,mainly for students that are able to understand and discuss programs’ execution flow and decide for the best set of breakpoints during a program analysis and exploration.Weaker students should periodically receive feedback regarding their performance while being supported through scaffolding mechanisms,guided by teachers and top performance students.
Key and Unique Features
Contrary to existing introductory programming books that only lightly leverage debugger for bug pinpointing and fixing purposes,this book goes deeper and fosters reverse engineering approach to explore and understand the mechanism of C language concepts.In doing so,a huge degree of excitement and motivation will be triggered,leading students to deeper engagement in their own learning and thus,avoiding procrastination.
Scope of Coverage(Organization and Content)
This book is organized in five chapters,covering C programming language what and how and ending by smoothly moving from C to C++ and the object-oriented programming paradigm.Chapter 1 briefly presents an overview of C language mechanism,a C programming environment and tools,and the C program life cycle.The main focus of Chapter 2 goes to problem-solving,al-gorithm and the internal of the function concept in C.Chapter 3 introduces the basics of the pointer variable in C,as well as how does it interoperate with other C language constructs like array and expressions.Chapter 4 focuses on advanced pointers features and how they interoperate with files,functions,passing of arguments,dynamic memory allocation and dynamic data structure.Finally,the focus of Chapter 5 goes towards a brief understanding of the object-oriented programming para-digm,C++ key concepts and refactoring of a C program to C++.
Acknowledgement and Thanks
Besides the authors,many other people influenced this book development and final form.Maybe,the greatest influence came from students who have attended our programming courses for the past years,as they have given great feedback about what works and does not in the classroom.Hence,we specially thank the students for their feedback.
We developed most,but not all,of figures in this book and thus,we would like to thank Tao Yu and Wang Yibo from Jilin University(China)for drawing some of them.
The reviewers for this book,Prof.Carlos Couto,Prof.Rufino Andrade,Prof.João Monteiro and Prof.Liang Yanchun were very helpful in improving the manuscript,both correcting errors and clarifying the presentation.