Preface of the book

In the modern world, computers, automated systems, and connected devices are at the heart of daily life for billions of people, and the automatic processing found in software or various computing systems is benefiting an ever-growing number of fields: medicine, finance, telecommunications, security, high technology, bioinformatics, agriculture, robotics, home automation, meteorology, management, video games, engineering, transportation, aerospace, artificial intelligence, marketing, scientific research, augmented reality, and many other areas.

With the development of artificial intelligence and Industry 4.0, additional jobs could disappear in favor of software and hardware systems that are automated and programmed to perform various tasks that were once manual. Thus, in many circles, there is an incentive to orient an increasing number of people toward IT professions to fill vacancies and train qualified professionals for current and future needs. Doing so will ensure that companies and states are not only prepared to confront current and future technological challenges but also to face competition from other companies or states.

In Canada and the United States, for example, IT jobs are currently popular and in demand. In addition to the many educational institutions that offer training programs in computer programming, there are currently also online self-study platforms such as Udemy, PluralSight, or W3Schools  that allow people to acquire or increase skills in computer coding. However, many develop skills in code technicalities (writing instructions, conditional tests, procedures, data structures, classes, loops, etc.) with less emphasis on the art of writing code, which involves the application of a rigorous and methodical style for writing computer code. In fact, when the rigorous and methodical side is absent or neglected, the resulting codes can be difficult to read, maintain, or understand; contain security flaws; or be inefficient in terms of execution speed or usage of computer resources. 

With the rise of generative artificial intelligence tools like Open AI ChatGPT, Microsoft Copilot and Google Gemini which are able to produce computer code on demand, it seems important for programmers to understand the methodical and rigorous aspects of writing computer code for several reasons: first, to be able to work very efficiently by exploiting the advanced tools of artificial intelligence; second, to be able to critically examine the codes generated by the tools in order to better optimize or refine them to meet particular requirements; third, to help or allow the tools to improve performance in generating quality computer code; and fourth, to avoid lagging behind or being supplanted by technology.

In this book, we present in the first chapter several recommendations to help programmers or their trainers develop the methodical and rigorous side of writing computer code, regardless of the programming language used. 

In the second chapter of this book, we introduce ecological programming, which we define as a style of computer programming aimed at making the best use of the energy resources of a computer or a digital calculator to avoid wasting energy and reduce the ecological footprint of computer programs. As an increasing number of governments around the world adopt various environmental policies, at the scale of computer programs, we can also adopt policies or code writing rules that limit overconsumption and inefficient use of computer resources (processor, memory, etc.) and networks transporting data processed by the programs. In this book, we present several recommendations for writing eco-friendly computer code.

To demonstrate in practical terms the implementation of our many recommendations for writing code, we propose several code examples in various programming languages: C, C++, C#, Java, JavaScript, PHP, Python, Ruby, Scheme, and WLanguage.

Whether you are a beginner, junior, intermediate, or experienced programmer, or even if you are a trainer of programmers, no matter what programming language you use or want to use to write computer code, this book is for you.