From fc0c66b312c16ff9a82c0b873872e3f97847524f Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Tue, 22 Jul 2025 12:00:10 -0700 Subject: [PATCH 01/10] Fix typos/grammar --- src/hash_maps/appropriate_keys.md | 2 +- src/hash_maps/hash_distribution.md | 2 +- src/hash_maps/reference_based_identity.md | 6 +++--- src/hash_maps/value_based_identity.md | 4 ++-- src/hyrums_law/authority.md | 2 +- src/hyrums_law/emergent_properties.md | 2 +- src/recursion/disclaimer.md | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/hash_maps/appropriate_keys.md b/src/hash_maps/appropriate_keys.md index 482a80a..19ca9cf 100644 --- a/src/hash_maps/appropriate_keys.md +++ b/src/hash_maps/appropriate_keys.md @@ -3,7 +3,7 @@ Both objects with reference based and value based definitions of `equals` and `hashCode` are "appropriate" to use as keys in `HashMap`s. -The most important thing to be careful of using objects where`equals` and `hashCode` +The most important thing to be careful of is using objects where`equals` and `hashCode` are value based, but the object itself is mutable. ```java diff --git a/src/hash_maps/hash_distribution.md b/src/hash_maps/hash_distribution.md index 61ba6ca..d229ed3 100644 --- a/src/hash_maps/hash_distribution.md +++ b/src/hash_maps/hash_distribution.md @@ -7,7 +7,7 @@ If you open up a doctor's office in South Boston, you might have an issue ordering charts by last name only. Your `M` cabinet will be overflowing.[^irish] For that scenario, using the first letter of the last name is a non-ideal hash function -because so when many people have last names starting with the same letter, they will +because when so many people have last names starting with the same letter, they will not be evenly distributed amongst the buckets. Making a hash function with a good distribution is hard. `Objects.hash` will do a decent job of it diff --git a/src/hash_maps/reference_based_identity.md b/src/hash_maps/reference_based_identity.md index 46d4706..c99d0dc 100644 --- a/src/hash_maps/reference_based_identity.md +++ b/src/hash_maps/reference_based_identity.md @@ -8,7 +8,7 @@ Instead of making buckets like `A-G` and `H-Z`, it will use ranges of numbers. T same though For classes you make yourself, their `hashCode` will be based on what we call an object's -"identity." This means that while different instances of a class might give the same +"identity." This means that while different instances of a class might give the same (incomplete sentence) ```java @@ -67,8 +67,8 @@ class Main { // Car C is a distinct object with its own identity var carC = new LivingRaceCar(10); - // Car C therefore only equal itself - // Car A and B will equal eachother + // Car C therefore will only equal itself + // Car A and B will equal each other IO.println("A.equals(A): " + carA.equals(carA)); IO.println("A.equals(B): " + carA.equals(carB)); IO.println("A.equals(C): " + carA.equals(carC)); diff --git a/src/hash_maps/value_based_identity.md b/src/hash_maps/value_based_identity.md index 21ff029..f53e718 100644 --- a/src/hash_maps/value_based_identity.md +++ b/src/hash_maps/value_based_identity.md @@ -1,7 +1,7 @@ # Value Based Identity -While reference based identity can be useful, its often not what you want for keys in a `HashMap`. -Ideally if you are looking up `"Tow Mater"` you shouldn't have to be careful to ensure its the *same* +While reference based identity can be useful, it's often not what you want for keys in a `HashMap`. +Ideally if you are looking up `"Tow Mater"` you shouldn't have to be careful to ensure it's the *same* instance of `String`, all you care about is that it contains the right characters. 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. diff --git a/src/hyrums_law/authority.md b/src/hyrums_law/authority.md index 1dd10af..09bf634 100644 --- a/src/hyrums_law/authority.md +++ b/src/hyrums_law/authority.md @@ -5,7 +5,7 @@ are not really laws in the same way as "The Law of Conservation of Energy." Those sorts of laws are observed truths about a field. Best we can tell they are always true, no matter what. -Hyrum's Law is just an aphorism. Its one specific person's view on the field. +Hyrum's Law is just an aphorism. It's one specific person's view on the field. This sounds sketchy, and it is, but the state of the computing field is such that aphorisms and personal anecdotes are often the best information we have. diff --git a/src/hyrums_law/emergent_properties.md b/src/hyrums_law/emergent_properties.md index 37ef9b5..aa71453 100644 --- a/src/hyrums_law/emergent_properties.md +++ b/src/hyrums_law/emergent_properties.md @@ -7,5 +7,5 @@ Hyrum's law is one of those sorts of things. Nobody sat down and agreed that they will use an API in wacky ways. It just happens when you throw enough monkeys in a pile and they all reach for a keyboard. -As such, the way to deal with it isn't to put blame upon the monkeys. Its +As such, the way to deal with it isn't to put blame upon the monkeys. It's to accept it as a naturally occurring phenominon and plan accordingly. \ No newline at end of file diff --git a/src/recursion/disclaimer.md b/src/recursion/disclaimer.md index 451c890..d7dd3aa 100644 --- a/src/recursion/disclaimer.md +++ b/src/recursion/disclaimer.md @@ -4,9 +4,9 @@ Recursion will be annoying to learn. Sorry. -Its not because its particuarly hard or because its -beyond your ken. Its just that when you learn loops first, recursion +It's not because it's particuarly hard or because it's +beyond your ken. It's just that when you learn loops first, recursion tends to be harder to learn than if you started with it. The good news is that once you get it, after however much -mental anguish, you won't forget it. And it will be useful, however occasionally. \ No newline at end of file +mental anguish, you won't forget it. And it will be useful, however occasional. \ No newline at end of file From 0def6f00088ba9690f67baa6a01affb8f5e9c257 Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Tue, 22 Jul 2025 12:03:00 -0700 Subject: [PATCH 02/10] Fix code example --- src/recursion/counting_down.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recursion/counting_down.md b/src/recursion/counting_down.md index 5e397bd..3468daf 100644 --- a/src/recursion/counting_down.md +++ b/src/recursion/counting_down.md @@ -8,7 +8,7 @@ number one lower than you were given. if it isn't you are done. ```java void countDown(int x) { - if (x > 0) { + if (x <= 0) { IO.println("DONE"); } else { From 3f8fcd8c83488207aaef94c3e3c7a4db627f3bb1 Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:02:16 -0700 Subject: [PATCH 03/10] Fix typo --- src/encapsulation/classes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encapsulation/classes.md b/src/encapsulation/classes.md index 7c4350d..64408c7 100644 --- a/src/encapsulation/classes.md +++ b/src/encapsulation/classes.md @@ -52,7 +52,7 @@ public class ArrayList extends AbstractList } ``` -People who write programs that depend on the calling `.add` on an `ArrayList` do not need +People who write programs that depend on calling `.add` on an `ArrayList` do not need to understand how or when the internal `elementData` and `size` fields are updated. Those also need not be the only fields that exist. All that is required is "calling `.add` will add an element to the list." From 1eb29efdc7ef9016be6c3cb3f5fc215b198cf552 Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:21:28 -0700 Subject: [PATCH 04/10] Fix typo --- src/encapsulation/coupling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encapsulation/coupling.md b/src/encapsulation/coupling.md index 82dc841..2aad6db 100644 --- a/src/encapsulation/coupling.md +++ b/src/encapsulation/coupling.md @@ -14,5 +14,5 @@ long as code that is coupled is also "co-located" making changes to that code can be easier than if it were spread over multiple files. A not insignificant part of practice in the coding world is deciding when -pieces of a program deserve to be abstracted from eachother (to minimize interdependence) +pieces of a program deserve to be abstracted from each other (to minimize interdependence) and when they deserve to be coupled together (to keep logic in one place.) \ No newline at end of file From ef909a6d5600e63b0c6f6ab4071310f76b1878d1 Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Wed, 23 Jul 2025 18:29:21 -0700 Subject: [PATCH 05/10] Fix typo --- src/collections/factories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collections/factories.md b/src/collections/factories.md index 4523db5..9ec9e60 100644 --- a/src/collections/factories.md +++ b/src/collections/factories.md @@ -62,7 +62,7 @@ class Main { } ``` -If you want the opposite - if you want to make a copy of a something like an `ArrayList` +If you want the opposite - if you want to make a copy of something like an `ArrayList` which does not support `.add`, `.remove`, etc. - you can use `copyOf`. ```java From b3e69dc0a756ff6c0ef883e3a483cc2baf09a229 Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:49:18 -0700 Subject: [PATCH 06/10] Fix grammar --- src/reflection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reflection.md b/src/reflection.md index e71e12a..f71eca1 100644 --- a/src/reflection.md +++ b/src/reflection.md @@ -1,6 +1,6 @@ # Reflection -Reflection is the what we call it when a program +Reflection is what we call it when a program uses information about how it - the program - is structured in order to do things while running. From 6b646e58d6a823d3c5759067310639ae5814004e Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:54:25 -0700 Subject: [PATCH 07/10] Fix grammar --- src/reflection.md | 2 +- src/reflection/class_objects.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reflection.md b/src/reflection.md index f71eca1..48f1378 100644 --- a/src/reflection.md +++ b/src/reflection.md @@ -4,7 +4,7 @@ Reflection is what we call it when a program uses information about how it - the program - is structured in order to do things while running. -We call it reflection because its as if your code +We call it reflection because it's as if your code looks into a mirror and sees its own reflection.[^whenhumans] [^whenhumans]: When a human looks into a mirror they might see their own eye color. diff --git a/src/reflection/class_objects.md b/src/reflection/class_objects.md index d8f0479..06cace6 100644 --- a/src/reflection/class_objects.md +++ b/src/reflection/class_objects.md @@ -41,5 +41,5 @@ up front you should use a wildcard. [^ifconfused]: If that seems confusing and useless, you are half right. It certainly is confusing, but it is pretty useful sometimes. -If its still beyond your ken just always write `Class` and we'll +If it's still beyond your ken just always write `Class` and we'll loop back to it. \ No newline at end of file From 9250427ba73d97eed3de1911663aa8d9c9c288e3 Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:59:48 -0700 Subject: [PATCH 08/10] Fix typo --- src/reflection/get_a_method.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reflection/get_a_method.md b/src/reflection/get_a_method.md index da1dc44..d36b788 100644 --- a/src/reflection/get_a_method.md +++ b/src/reflection/get_a_method.md @@ -21,7 +21,7 @@ class Tea { ``` -Unlike fields which can be identified only by their name, methods which are distinct overloads of eachother +Unlike fields which can be identified only by their name, methods which are distinct overloads of each other are distinguised by the arguments they take in. ```java From 8b25f0dd601424e326f04228f072642f091b2650 Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Thu, 24 Jul 2025 03:40:31 -0700 Subject: [PATCH 09/10] Fix typo --- src/interfaces_ii.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces_ii.md b/src/interfaces_ii.md index 729961b..129b3af 100644 --- a/src/interfaces_ii.md +++ b/src/interfaces_ii.md @@ -3,5 +3,5 @@ Interfaces let you describe a common set of methods shared by different implementing classes. -They can do slightly more than this though and its helpful +They can do slightly more than this though and it's helpful to know about. \ No newline at end of file From c6eead92577eae42ddef558daf539704d11016ad Mon Sep 17 00:00:00 2001 From: zohairawan <35776095+zohairawan@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:00:28 -0700 Subject: [PATCH 10/10] Fix typo --- src/interfaces_ii/static_methods.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interfaces_ii/static_methods.md b/src/interfaces_ii/static_methods.md index 7aa9699..cdd780e 100644 --- a/src/interfaces_ii/static_methods.md +++ b/src/interfaces_ii/static_methods.md @@ -13,8 +13,8 @@ interface Animal { // My cousin has a Pig that we were all afraid // was going to straight up eat her child. // - // The child got old enough that its not a concern, - // but good god. + // The child got old enough that it's not a concern, + // but good God. return false; } }