Skip to content

Commit

Permalink
add note before picture for easier understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
zakirullin committed Oct 6, 2024
1 parent 0e2d90c commit 0cbc532
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ The tricky part is that the author may not have experienced a high cognitive loa
>
> *Thanks to [Dan North](https://dannorth.net) for his comment*.
Over time, the author learns the mental models of the project and doesn't experience any cognitive load.

![Mental Models](/img/mentalmodelsv8.png)

Once you onboard new people on your project, try to measure the amount of confusion they have (pair programming may help). If they're confused for more than ~40 minutes in a row - you've got things to improve in your code.
When you onboard new people on your project, try to measure the amount of confusion they have (pair programming may help). If they're confused for more than ~40 minutes in a row - you've got things to improve in your code.

## Types of cognitive load
**Intrinsic** - caused by the inherent difficulty of a task. It can't be reduced, it's at the very heart of software development.
Expand Down Expand Up @@ -149,7 +151,7 @@ P.S. If you think we are rooting for bloated God objects with too many responsib
## Shallow modules and SRP
All too often, we end up creating lots of shallow modules, following some vague "a module should be responsible for one, and only one, thing" principle. What is this blurry one thing? Instantiating an object is one thing, right? So `MetricsProviderFactoryFactory` seems to be just fine. The names and interfaces of such classes tend to be more mentally taxing than their entire implementations, what kind of abstraction is that? Something went wrong.

> Jumping between such shallow components is also mentally taxing, [linear thinking](https://blog.separateconcerns.com/2023-09-11-linear-code.html) is more natural to us humans.
> Jumping between such shallow components is also mentally exhausting, [linear thinking](https://blog.separateconcerns.com/2023-09-11-linear-code.html) is more natural to us humans.
We make changes to our systems to satisfy our users and stackeholders. We are responsible to them.

Expand Down

0 comments on commit 0cbc532

Please sign in to comment.