Skip to content

Commit a7dcf5c

Browse files
authored
Merge branch 'develop' into develop
2 parents 41c8edd + 492fb9f commit a7dcf5c

25 files changed

+37
-33
lines changed

src/collections/factories.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class Main {
6262
}
6363
```
6464

65-
If you want the opposite - if you want to make a copy of a something like an `ArrayList`
65+
66+
If you want the opposite - if you want to make a copy of something like an `ArrayList`
6667
which does not support `.add`, `.remove`, etc. - you can use `copyOf`.
6768

6869
```java

src/encapsulation/classes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public class ArrayList<E> extends AbstractList<E>
5252
}
5353
```
5454

55-
People who write programs that depend on the calling `.add` on an `ArrayList` do not need
55+
56+
People who write programs that depend on calling `.add` on an `ArrayList` do not need
5657
to understand how or when the internal `elementData` and `size` fields are updated. Those also
5758
need not be the only fields that exist. All that is required is "calling `.add` will add an element to the list."
5859

src/encapsulation/coupling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ long as code that is coupled is also "co-located" making changes
1414
to that code can be easier than if it were spread over multiple files.
1515

1616
A not insignificant part of practice in the coding world is deciding when
17-
pieces of a program deserve to be abstracted from eachother (to minimize interdependence)
17+
pieces of a program deserve to be abstracted from each other (to minimize interdependence)
1818
and when they deserve to be coupled together (to keep logic in one place.)

src/files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Files are how you store information
44
on a[^normal] computer so that it can still be there when your program
55
is done running.
66

7-
As such, read files and writing files are tasks you will often want to do.
7+
As such, reading files and writing files are tasks you will often want to do.
88

99
[^normal]: *normal

src/generics/raw_types.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ void main() {
3939

4040
Raw types exist for two basic reasons
4141

42-
1. Every now and then Java isn't smart enough. Trust that there are valid reasons to turn off generics, even
43-
I haven't shown you any yet. Avoid doing so yourself - at least for awhile.
42+
1. Every now and then Java isn't smart enough. Trust that there are valid reasons to turn off generics, even if I haven't shown you any yet. Avoid doing so yourself - at least for awhile.
4443
2. Generics weren't always in Java! Classes that later were made generic had to stay compatible with old "raw"
4544
usages somehow.
4645

src/hash_maps/appropriate_keys.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Both objects with reference based and value based definitions of `equals` and `hashCode`
44
are "appropriate" to use as keys in `HashMap`s.
55

6-
The most important thing to be careful of using objects where`equals` and `hashCode`
6+
7+
The most important thing to be careful of is using objects where `equals` and `hashCode`
78
are value based, but the object itself is mutable.
89

910
```java

src/hash_maps/hash_distribution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ If you open up a doctor's office in South Boston, you might have an issue
77
ordering charts by last name only. Your `M` cabinet will be overflowing.[^irish]
88

99
For that scenario, using the first letter of the last name is a non-ideal hash function
10-
because so when many people have last names starting with the same letter, they will
10+
because when so many people have last names starting with the same letter, they will
1111
not be evenly distributed amongst the buckets.
1212

1313
Making a hash function with a good distribution is hard. `Objects.hash` will do a decent job of it

src/hash_maps/reference_based_identity.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Instead of making buckets like `A-G` and `H-Z`, it will use ranges of numbers. T
88
same though
99

1010
For classes you make yourself, their `hashCode` will be based on what we call an object's
11-
"identity." This means that while different instances of a class might give the same
11+
"identity." This means that while different instances of a class might give the same (incomplete sentence)
1212

1313

1414
```java
@@ -67,8 +67,8 @@ class Main {
6767
// Car C is a distinct object with its own identity
6868
var carC = new LivingRaceCar(10);
6969

70-
// Car C therefore only equal itself
71-
// Car A and B will equal eachother
70+
// Car C therefore will only equal itself
71+
// Car A and B will equal each other
7272
IO.println("A.equals(A): " + carA.equals(carA));
7373
IO.println("A.equals(B): " + carA.equals(carB));
7474
IO.println("A.equals(C): " + carA.equals(carC));

src/hash_maps/value_based_identity.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Value Based Identity
22

3-
While reference based identity can be useful, its often not what you want for keys in a `HashMap`.
4-
Ideally if you are looking up `"Tow Mater"` you shouldn't have to be careful to ensure its the *same*
3+
4+
While reference based identity can be useful, it's often not what you want for keys in a `HashMap`.
5+
Ideally if you are looking up `"Tow Mater"` you shouldn't have to be careful to ensure it's the *same*
56
instance of `String`, all you care about is that it contains the right characters.
67

78
We call this notion of identity "value based." Two things are the same if they contain the same data - i.e. if they represent the same value.

src/hyrums_law/authority.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ are not really laws in the same way as "The Law of Conservation of Energy."
55

66
Those sorts of laws are observed truths about a field. Best we can tell they are always true, no matter what.
77

8-
Hyrum's Law is just an aphorism. Its one specific person's view on the field.
8+
Hyrum's Law is just an aphorism. It's one specific person's view on the field.
99

1010
This sounds sketchy, and it is, but the state
1111
of the computing field is such that aphorisms and personal anecdotes are often the best information we have.

0 commit comments

Comments
 (0)