StefanSalewski / NimProgrammingBook

Computer Programming with the Nim Programming Language -- A gentle Introduction
262 stars 19 forks source link

Minor styling fixes #6

Closed marek-lach closed 3 years ago

marek-lach commented 3 years ago

Just some more grammar fixes & also a few suggestions from me about expanding some sections a little more clearly for non-programmers. Feel free to adopt any changes from this PR as you best see fit!

Thanks,

StefanSalewski commented 3 years ago

OK, I have applied most of your fixes. One exception is that I keep the term storing instead of saving, as in computer text books we generally say that a value is stored in a CPU register.

And I had to refuse using some of your very long and difficulty sentences:

This splitting of the various distinct types of data manipulating structures into parts, an overarching problem into small, single-purposed sequence of actions, ordered according to the nature of the data manipulation operations that they process for the larger program between each-other, is mapped onto programming languages, by grouping tasks into their own subroutines, functions or procedures, which accept a set of input parameters and can return a result.

These languages already support some higher order data types, which are data categorizations, according to the kinds of operations that can be performed on the data, such as floating point numbers, or with text (strings), and homogeneous, fixed size containers (called arrays in C) or heterogeneous fixed size containers (called structs in C).

I will upload the fixes this evening:

3c3
< //v0.1, 2021-SEP-16
---
> //v0.1, 2021-AUG-28
83c83
< Science# (CS) in school. But still, there are people who missed this introduction in
---
> Science# (CS) in school. But still there are people who missed this introduction in
126,129c126
< A computer is primarily a device which can run computer programs, by following
< instructions about how to manipulate data.
< 
< Nearly all of the
---
> A computer is primarily a device which can run computer programs.  Nearly all
131,132c128,129
< well known desktop computers (PCs), to large and powerful super computers filling out
< entire rooms, work internally with digital data only.footnote:[In the past, some form
---
> well known desktop computers (PCs), to large and powerful super computers filling
> whole rooms, work internally with digital data only.footnote:[In the past some form
136,137c133,134
< electric voltages.] Digital data are basically integer (whole) numbers encoded in
< binary form, which are represented by sequences of the symbols [.ndef]#0# and [.ndef]#1#.  We
---
> electric voltages.] Digital data is basically integer (whole) numbers encoded in
> binary form, represented by sequences of the symbols [.ndef]#0# and [.ndef]#1#.  We
254c251
< values. When you use a mechanical switch to turn the light bulb in your house on, or
---
> values. When you use a mechanical switch to turn the light bulb in your house on or
364c361
< CPU where numbers can be stored. As there exist many different types of CPUs, all
---
> CPU where numbers can be stored. As there exists many different types of CPUs all
399c396
< representative pattern of all the necessary steps required to perform a certain task.
---
> represented pattern of all the necessary steps required to perform a certain task.
431,434c428,431
< operations, recovery from errors and maybe plausibility checks. A more complicated algorithm
< generally can be split into various separate logical parts, which may include reading in data at one point,
< multiple processing steps at another, and storing, or displaying data as plain text, graphic or
< animation at yet another point. This splitting into parts is mapped to programming languages by grouping
---
> operations, recovery from errors and maybe plausibility checks. Complicated algorithm
> generally can be split into various logical parts, which may include reading in data,
> multiple processing steps, and storing or displaying data as plain text, graphic or
> animation. This splitting into parts is mapped to programming languages by grouping
438,445d434
< # Propose of
< #This splitting of the various distinct types of
< #data manipulating structures into parts, an overarching problem into small, single-purposed sequence
< #of actions, ordered according to the nature of the data manipulation operations that they process for
< #the larger program between each-other, is mapped onto programming languages, by grouping tasks
< #into their own subroutines, functions or procedures, which accept a set of input parameters and can
< #return a result. 
< 
519,521c508
< easy for programmers.  These languages already support some higher order data types,
< #which are data categorizations, according to the kinds of operations that
< #can be performed on the data, such as floating
---
> easy for programmers.  These languages already support some higher order data types
533,534c520,521
< that is, they use variables which can store any data type, so the variable's type
< of data that it accepts can therefore dynamically change during program execution. That seems comfortable for the user, and
---
> that is, they use variables which can store any data type, and the variable's type
> of data it accepts can therefore dynamically change during program execution. That seems comfortable for the user, and
546c533
< the variable's type does never change. In this way, the compiler can check for logical
---
> the variable's type does never change. In this way the compiler can check for logical
853,854c840,841
< we have high level concepts available like in Python, but we have access to
< low level stuff too, so we can really understand the internal workings, if we want.
---
> we have high level concepts available as in Python, but we have access to
> low level stuff too, so we can really understand the internal working if we want.
965c952
< short for integer and indicates, that our variable should be able to store negative or
---
> short for integer and indicates that our variable should be able to store negative or
1722,1723c1709,1710
< the value is a result of a prior calculation. But let indicates, at the same time, that
< the assignment occurs only once, the content does not change later, during the program's execution. We say that the
---
> the value is a result of a prior calculation. But let indicates at the same time that
> the assignment occurs only once, the content does not change later.  We say that the
1725,1726c1712,1713
< source code with understanding what is going on, and it may also help the compiler doing
< optimizations to get faster, or more compact code. For now, we can just ignore let
---
> source code understanding what in going on, and it may also help the compiler doing
> optimizations to get faster or more compact code. For now we can just ignore let
3039c3026
< Nim currently doess not allow to insert tabular characters (tabs) in your source code,
---
> Nim does currently not allow to insert tabular characters (tabs) in your source code,
3231,3232c3218,3219
< contain an else. A plain if, without else, or an if/elif without an else does not
< work. And as Nim is a statically typed language and all variables have a strictly well defined
---
> contain an else. A plain if without else, or an if/elif without an else does not
> work. And as Nim is a statically typed language and all variables have a well defined
10094c10081
< large stack, the program may fail with a stack overflow error. Generally, we have no real problem with
---
> large stack, the program may fail with a stack overflow error. Generally we have no real problem with
10098c10085
< always an extreme values is stored. So our partition would work very badly, in each step we would get a new range with only
---
> always an extreme values is stored. So our partition would work very bad, in each step we would get a new range with only
10114c10101
< from above are tiny:footnote:[Unfortunately, we have used the term STACK in two different meanings in this section:
---
> from above are tiny:footnote:[Unfortunately we have used the term STACK in two different meanings in this section:
10456,10457c10443,10444
< not easy to remember details.footnote:[From introductory courses to Computer Science,
< people generally remember QuickSort best, just because of its name and its good performance,
---
> not easy to remember details.footnote:[From introducing courses to Computer Science
> people generally remembers QuickSort best, just because of its name and its good performance
marek-lach commented 3 years ago

Oh, much thanks. Good look with finishing the book further!