Skip to content

Commit 0973276

Browse files
committed
chapter digitalrealities edited
1 parent 4f56bfc commit 0973276

File tree

10 files changed

+72
-28
lines changed

10 files changed

+72
-28
lines changed

.dockerignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/bin
15+
**/charts
16+
**/docker-compose*
17+
**/compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# GCC support can be specified at major, minor, or micro version
2+
# (e.g. 8, 8.2 or 8.2.0).
3+
# See https://hub.docker.com/r/library/gcc/ for all supported GCC
4+
# tags from Docker Hub.
5+
# See https://docs.docker.com/samples/library/gcc/ for more on how to use this image
6+
FROM gcc:latest
7+
8+
# These commands copy your files into the specified directory in the image
9+
# and set that as the working location
10+
COPY . /usr/src/myapp
11+
WORKDIR /usr/src/myapp
12+
13+
# This command compiles your app using GCC, adjust for your source code
14+
RUN g++ -o myapp main.cpp
15+
16+
# This command runs your application, comment out this line to compile only
17+
CMD ["./myapp"]
18+
19+
LABEL Name=theprogrammersfieldguide Version=0.0.1

src/content/docs/book/part-0-getting-started/00-introduction.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ sidebar:
66

77
## Welcome to the Programmer's Field Guide
88

9-
Wherever you look, computers and software are driving the world. The ability to understand and shape how these computers operate will ensure that you can make the most of these tools, and connect with the growing field of computing.
9+
Wherever you look, computers and software are driving the world. Your ability to understand and shape how these computers operate will ensure that you can make the most of these tools, and connect with the growing field of computing.
1010

11-
The Programmer's Field Guide will take you on a journey, guiding you to develop the skills you need to understand and build software and engage with the growing capabilities that computing offers. Through your journey, you will explore computing, how computers work, and the code to make them work for you. You will acquire new acquire tools for your toolbelt, with an understanding of what these tools do, when to use them, and how they work. The knowledge, skills, and attitudes you develop through this journey will set you up with the capability to engage in the computing profession and keep learning programming languages, libraries, and tools as you and the field grow and change over time.
11+
The Programmer's Field Guide will take you on a journey, guiding you to develop the skills you need to understand and build software, and engage with the growing capabilities that computing offers. Through your journey, you will explore computing, how computers work, and the code to make them work for you. You will acquire new tools for your toolbelt, with an understanding of what these tools do, when to use them, and how they work. The knowledge, skills, and attitudes you develop through this journey will set you up with the capability to engage in the computing profession and to keep learning programming languages, libraries, and tools as you and the field grow and change over time.
1212

13-
This first chapter will explain the path ahead. It will give you an overview of the parts in the book, and the chapters in this first part.
13+
This introduction will describe the path ahead. It will give you an overview of the parts that comprise the book, and the chapters in this first part.
1414

15-
By the end of this chapter you will be able to:
15+
By the end of this introduction you will be able to:
1616

1717
- Describe the main parts of the field guide and the emphasis of each part.
1818
- Gather the resources you need to get started learning to program.
@@ -21,29 +21,29 @@ By the end of this chapter you will be able to:
2121

2222
This book focuses on helping you develop a strong mental model of programming. It takes a bottom-up approach to introducing tools and capabilities so that you can understand how different things build upon each other. Initially, you will explore how instructions in the computer work at the lower levels. This will help you understand what is happening as your programs run and how the different parts all work together. When you understand this, you'll be able to explain how your programs work and know how to get new things working in the future. If the lower levels are particularly interesting to you, have a look at books on computer systems. These often explore the lower-level aspects of how computers work, all the way down to logic gates and how these can be combined to build a computer. The book [From Nand to Tetris](https://www.nand2tetris.org) is a great example of this.
2323

24-
We are currently in **Part 0**, which sets the background for the book. In this part, the introduction outlines the approach of the book, and the remaining chapters on [Digital Realities](../1-digital-realities/0-overview), [Computer Use](../2-computer-use/0-overview), and [Building Programs](../3-building-programs/0-overview) help you start to work with the computer through command line instructions and low-level tools.
24+
We are currently in **Part 0**, which sets the background for the book. In this part, the introduction outlines the approach of the book, and the remaining chapters on [Digital Realities](../1-digital-realities/0-overview), [Computer Use](../2-computer-use/0-overview), and [Building Programs](../3-building-programs/0-overview) help you start working with the computer through command line instructions and low-level tools.
2525

26-
**Part 1** of the book will focus on *programs as instructions*. This part will help you understand how the most basic elements or abstractions work within a digital reality. Understanding how these elements work individually will help you see how they are combined to create programs. The programs you make in this section will be relatively small, enabling you to focus on the mechanics and effect of each individual instruction. Your learning from this part will give you a solid foundation upon which to start building larger programs.
26+
**Part 1** of the book focuses on *programs as instructions*. This part will help you understand how the most basic elements or abstractions work within a digital reality. Understanding how these elements work individually will help you see how they are combined to create programs. The programs you make in this section will be relatively small, enabling you to focus on the mechanics and effects of each individual instruction. Your learning from this part will give you a solid foundation upon which to start building larger programs.
2727

28-
**Part 2** builds on this foundation, taking it to another level of abstraction by exploring how we can start building larger *things* within our programs. We will introduce you to tools for combining elements and packaging instructions and data into entities. The programs you make in this section will start to get a little larger as you build more meaningful entities. However, we will focus mostly on the *tools* we have to organise the code in our programs. What you learn from this will help set you up to start thinking about how we decide *which tools* we use and *when*.
28+
**Part 2** builds on this foundation, taking it to the next level of abstraction by exploring how you can start building larger *things* within your programs. We will introduce you to tools for combining elements and packaging instructions and data into entities. The programs you make in this section will start to get a little larger as you build more meaningful entities. However, this part focuses mostly on the *tools* available to organise the code in our programs. What you learn here will help set you up to start thinking about how we decide *which tools* to use and *when*.
2929

30-
In **Part 3**, we will move away from code to think more about software design. Building upon your understanding of how programs work as instructions, and how to organise these instructions to build larger *things*, you will learn how you can think about programs as *conceptual models*. With this understanding, you will have the knowledge and skills needed to design and create sophisticated programs.
30+
**Part 3**, moves away from code to think more about software design. Building upon your understanding of how programs work as instructions, and how to organise these instructions to build larger *things*, you will learn how you can think about programs as *conceptual models*. With this understanding, you will have the knowledge and skills needed to design and create sophisticated programs.
3131

32-
The toolkit you develop over parts 1 to 3 enable you to create any kind of digital reality. We'll explore this further in **Part 4** by looking at how to use the things you have learnt to build a range of real-world software systems. The will introduce you to some of the new paths you will be able to travel.
32+
The toolkit you develop over parts 1 to 3 enable you to create any kind of digital reality. We'll explore this further in **Part 4** by looking at how to use the things you have learnt to build a range of real-world software systems. We will introduce you to some of the new paths you will be able to travel.
3333

3434
## What do I need?
3535

36-
Programming is a practical skill that will require time and effort to master. In order to practice, you will need access to a computer and a set of programming tools. The tasks and activities in the Programmer’s Field Guide are designed to work on a range of computers, using free and open source tools.
36+
Programming is a practical skill that requires time and effort to be mastered. In order to practice, you will need access to a computer and a set of programming tools. The tasks and activities in the Programmer’s Field Guide are designed to work on a range of computers, using free and open source tools.
3737

38-
While you could use any computer, the field guide targets the [Raspberry Pi](https://www.raspberrypi.org) single-board computer. If you can get yourself a Raspberry Pi, then you will be set for the journey. For the adventurous, we recommend the **Programmer's Multi-Tool** - a custom designed hardware setup. This can be your physical companion on your quest to acquire mastery of the field. [Chapter 2](../2-computer-use/0-overview) has instructions on getting your Raspberry Pi or computer set up.
38+
While you could use any computer, the field guide targets the [Raspberry Pi](https://www.raspberrypi.org) single-board computer. If you can get yourself a Raspberry Pi, then you will be set for the journey. For the adventurous, we recommend the **Programmer's Multi-Tool** - a custom designed hardware setup. This can be your physical companion on the quest to acquire mastery of the field. [Chapter 2](../2-computer-use/0-overview) has instructions on getting your Raspberry Pi or computer set up.
3939

4040
:::tip[Multi-Tool]
4141

4242
The **Programmer's Multi-Tool** is a Raspberry Pi based project, with everything you need to build your own small computer. If you have access to a Makerspace, you can purchase the parts and put this together in no time.
4343

4444
:::
4545

46-
Another good thing to have is some company. While you can travel this journey solo, it is usually better with friends. An ideal travel group would include an experienced guide and some companions who are taking the trip for the first time. If you are at school or university, this will be your tutor and fellow students. Your tutor can help you engage with ideas and provide you with feedback on activities as you go. Your fellow students can help you learn by discussing ideas together and sharing the successes and challenges you encounter along the way.
46+
Another good thing to have is company. While you can travel this journey solo, it is usually better with friends. An ideal travel group would include an experienced guide and some companions who are taking the trip for the first time. If you are at school or university, this will be your tutor and fellow students. Your tutor can help you engage with ideas and provide you with feedback on activities as you go. Your fellow students can help you learn by discussing ideas together and sharing the successes and challenges you encounter along the way.
4747

4848
If you are not already doing this with others, you should consider finding a study group to join. Learning to program can be challenging, so having others to help guide and support you can make a big difference.
4949

@@ -59,7 +59,7 @@ However, the examples and activities in this book will use a specific language.
5959

6060
### *So which language will I use?*
6161

62-
The book starts with C# for Part 1, transitions to C/C++ for the start of Part 2, then returns to C#. This will ensure you are using an appropriate language when learning each concept because some things don’t really exist in C#, or are unnecessary challenging in C/C++. Mixing the two will give us an easier journey, while still allowing us to explore all of the necessary paths. The good thing is, both languages have a common syntax, known as "C-style", meaning the transition shouldn’t be too challenging.
62+
The book starts with C# in Part 1, transitions to C/C++ at the start of Part 2, then returns to C#. This will ensure you are using an appropriate language when learning each concept because some things don’t really exist in C#, or are unnecessary challenging in C/C++. Mixing the two will give us an easier journey, while still allowing us to explore all of the necessary paths. The good thing is, both languages have a common syntax, known as "C-style", meaning the transition shouldn’t be too challenging.
6363

6464
While the guide uses these languages to demonstrate programming concepts, it will not explore either one in depth. It will not focus on or examine things that are not common elsewhere. This means that you will need further study and practice after finishing this book to say that you have *learnt* C# or C/C++ in detail. But the great thing is that after finishing this book you will have all of the skills and understanding you need to learn C#, C/C++, and many other languages using resources available online and through things like generative artificial intelligence.
6565

src/content/docs/book/part-0-getting-started/1-digital-realities/1-concepts/3-digital-realities-and-abstraction.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66

77
Before we move on, we need to think a little about how these digital realities come into existence.
88

9-
Generally, you will find that programming textbooks will describe programming in terms of **abstraction**. This comes from thinking about how a computer works and the process we use to create digital realities. To see this, we need to think about what a computer is.
9+
Generally, you will find that programming textbooks will describe programming in terms of **abstraction**. This comes from thinking about how a computer works and the process we use to create digital realities. To understand this, we need to think about what a computer is.
1010

1111
A computer is an electronic device. It operates by controlling voltage through its circuits. Transistors enable us to create gates that control the current. Lots of gates are combined to form the processing units of the computer, where the flow of current can be controlled to achieve computations. Gates are also used to alter the flow of current through memory chips, controlling which parts of the chips retain, gain, or lose current. So, at this level of thinking, a computer is just electrical current flowing through a circuit.
1212

@@ -18,8 +18,8 @@ Using abstraction, we can *imagine* that the presence of current at a certain lo
1818

1919
Taking abstraction to the next level, we can use these binary values both to represent data within the computer, and control the computations occurring within its processors. One way we do this is by grouping binary values to represent a number. For example, 8 bits (a **byte**) gives us 256 (2<sup>8</sup>) unique values. Two common ways of interpreting the 256 unique values in a byte is as a number from 0 to 255, or a number from -128 to 127. The actual values of the 8 bits in both cases are the same, but the way we *interpret* them changes depending on the reality we are imagining. We can abstract this idea further, using bytes to represent real numbers (numbers with decimal points) with a fixed degree of accuracy, individual characters of text, colours of images, signals of audio, and basically anything else we can think of.
2020

21-
Abstracting further, we can combine individual values into entities like bank accounts, characters and levels in games, documents in a word processor, or any other *thing* we want to represent within the digital realities we are creating.
21+
Abstracting further, we can combine individual values into entities like characters and levels in games, documents in a word processor, bank accounts, or any other *thing* we want to represent within the digital realities we are creating.
2222

23-
By using **abstraction** we can work at higher levels and avoid needing to think about the details of how everything actually works. We can spend our time picturing the reality we want to create and crafting the code needed to produce it.
23+
By using **abstraction** we can work at higher levels and avoid needing to think about current, bits, or any other details of how everything actually works. We can spend our time picturing the reality we want to create and crafting the code needed to produce it.
2424

2525
_**This** is what software development is all about._

src/content/docs/book/part-0-getting-started/1-digital-realities/1-concepts/4-machine-code.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Let’s explore the application of abstraction to the instructions we give compu
88

99
### Programming in Machine Code
1010

11-
The following snippet shows a chunk of the machine code for a small program. You can see that 1s and 0s are group together. These groups form the instructions followed by the computer when this program is executed. Programs can be written directly in machine code like this, but it is a time consuming task. The task is further complicated by the fact that machine code is unique to each kind of CPU. For example, x86 instructions differ from ARM instructions. This means that programming at this level is entirely dependent on the kind of processor that you are targeting.
11+
The following snippet shows a chunk of the machine code for a small program. You can see that 1s and 0s are grouped together. These groups form the instructions that are followed by the computer when this program is executed. Programs can be written directly in machine code like this, but it is a time consuming task. The task is further complicated by the fact that machine code is unique to each kind of CPU. For example, x86 instructions differ from ARM instructions. This means that programming at this level is entirely dependent on the kind of processor that you are targeting.
1212

1313
```
1414
...
@@ -17,7 +17,7 @@ The following snippet shows a chunk of the machine code for a small program. You
1717
...
1818
```
1919

20-
No one wants to have to work at this level of detail, and fortunately you don't need to. Software developers have created tools to help us to work at higher levels of abstraction and create programs without having to think about low level details. These tools work by taking the code you write and doing the tedious work of converting that code to the machine code of the computer you want to run it on.
20+
It is extremely difficult to work at this level of detail, and fortunately you don't need to. Software developers have created tools to help us to work at higher levels of abstraction and create programs without having to think about low level details. These tools work by taking the code you write and doing the tedious work of converting that code into the machine code of the computer you want to run it on.
2121

2222
:::tip[Hex Editor]
2323

0 commit comments

Comments
 (0)