You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,6 @@ then open a pull request. :zap:
21
21
* Don’t leave trailing whitespace.
22
22
* Not even leading indentation on blank lines.
23
23
24
-
25
24
#### Prefer `let`-bindings over `var`-bindings wherever possible
26
25
27
26
Use `let foo = …` over `var foo = …` wherever possible (and when in doubt). Only use `var` if you absolutely have to (i.e. you *know* that the value might change, e.g. when using the `weak` storage modifier).
@@ -34,7 +33,7 @@ It becomes easier to reason about code. Had you used `var` while still making th
34
33
35
34
Accordingly, whenever you see a `var` identifier being used, assume that it will change and ask yourself why.
36
35
37
-
### Return and break early
36
+
####Return and break early
38
37
39
38
When you have to meet certain criteria to continue execution, try to exit early. So, instead of this:
40
39
@@ -56,7 +55,6 @@ guard n.isNumber else {
56
55
57
56
You can also do it with `if` statement, but using `guard` is prefered, because `guard` statement without `return`, `break` or `continue` produces a compile-time error, so exit is guaranteed.
58
57
59
-
60
58
#### Avoid Using Force-Unwrapping of Optionals
61
59
62
60
If you have an identifier `foo` of type `FooType?` or `FooType!`, don't force-unwrap it to get to the underlying value (`foo!`) if possible.
@@ -309,3 +307,4 @@ _Rationale:_ Operators consist of punctuation characters, which can make them di
Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.
Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.
🎥 Watch TMZ Live
TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.
0 commit comments