Skip to content

Commit fc0c66b

Browse files
committed
Fix typos/grammar
1 parent 50271bf commit fc0c66b

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/hash_maps/appropriate_keys.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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+
The most important thing to be careful of is using objects where`equals` and `hashCode`
77
are value based, but the object itself is mutable.
88

99
```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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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+
While reference based identity can be useful, it's 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 it's the *same*
55
instance of `String`, all you care about is that it contains the right characters.
66

77
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.

src/hyrums_law/emergent_properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Hyrum's law is one of those sorts of things. Nobody sat down and agreed
77
that they will use an API in wacky ways. It just happens when you throw enough
88
monkeys in a pile and they all reach for a keyboard.
99

10-
As such, the way to deal with it isn't to put blame upon the monkeys. Its
10+
As such, the way to deal with it isn't to put blame upon the monkeys. It's
1111
to accept it as a naturally occurring phenominon and plan accordingly.

src/recursion/disclaimer.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Recursion will be annoying to learn.
44

55
Sorry.
66

7-
Its not because its particuarly hard or because its
8-
beyond your ken. Its just that when you learn loops first, recursion
7+
It's not because it's particuarly hard or because it's
8+
beyond your ken. It's just that when you learn loops first, recursion
99
tends to be harder to learn than if you started with it.
1010

1111
The good news is that once you get it, after however much
12-
mental anguish, you won't forget it. And it will be useful, however occasionally.
12+
mental anguish, you won't forget it. And it will be useful, however occasional.

0 commit comments

Comments
 (0)