Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
yingang committed Mar 17, 2024
1 parent 3d3bb4b commit 58833c1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/ch15.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 第 15 章 先写注释
(把注释变成设计过程的一部分)

> Chapter 15 Write The Comments First
> (Use Comments As Part Of The Design Process)
Expand Down
2 changes: 1 addition & 1 deletion docs/ch18.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void* Buffer::allocAux(size_t numBytes) {
// Must create a new space allocation; allocate space within it.
uint32_t allocatedLength;
firstAvailable = getNewAllocation(numBytes32, &allocatedLength);
availableLength = allocatedLength numBytes32;
availableLength = allocatedLength - numBytes32;
return firstAvailable + availableLength;
}
```
Expand Down
3 changes: 2 additions & 1 deletion docs/en/ch15.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Chapter 15 Write The Comments First(Use Comments As Part Of The Design Process)
# Chapter 15 Write The Comments First
(Use Comments As Part Of The Design Process)

Many developers put off writing documentation until the end of the development process, after coding and unit testing are complete. This is one of the surest ways to produce poor quality documentation. The best time to write comments is at the beginning of the process, as you write the code. Writing the comments first makes documentation part of the design process. Not only does this produce better documentation, but it also produces better designs and it makes the process of writing documentation more enjoyable.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/ch18.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void* Buffer::allocAux(size_t numBytes) {
// Must create a new space allocation; allocate space within it.
uint32_t allocatedLength;
firstAvailable = getNewAllocation(numBytes32, &allocatedLength);
availableLength = allocatedLength numBytes32;
availableLength = allocatedLength - numBytes32;
return firstAvailable + availableLength;
}
```
Expand Down

0 comments on commit 58833c1

Please sign in to comment.