Skip to content

Commit

Permalink
Fixed typos in notes by @krzysztof-frzybek
Browse files Browse the repository at this point in the history
  • Loading branch information
arialdomartini committed May 22, 2020
1 parent 40d929d commit a6bdc69
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions design-patterns/globals-are-evil.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Why are global and static objects evil? Can you show it with a code example?
# Globals are evil

## [Krzysztof Grzybek](https://github.com/krzysztof-grzybek)
Some hints by [Krzysztof Grzybek](https://github.com/krzysztof-grzybek):

1. Global and static objects causes implicit dependencies/coupling, thus breaks the idea of encapsulation.
1. Global and static objects cause implicit dependencies/coupling, thus they break the idea of encapsulation.
2. It's hard to reason about them - logical scope for understanding behaviour of these objects is expanded to the whole program.
3. It's Hard to mock/stub them.
4. Global objects pollutes the main scope.
3. It's hard to mock/stub them.
4. Global objects pollute the main scope.

Bad:
```javascript
Expand Down

0 comments on commit a6bdc69

Please sign in to comment.