Skip to content

Commit 2fb3b81

Browse files
committed
minor wording changes.
1 parent 53842b6 commit 2fb3b81

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

proposals/0004-remove-pre-post-inc-decrement.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,33 @@ popular languages which have kept the majority of C operators but dropped these
4242
## Disadvantages of These Operators
4343

4444
1. These operators increase the burden to learn Swift as a first programming
45-
language (or in other cases where you don't already know these operators from a
46-
different language).
45+
language - or any other case where you don't already know these operators from a
46+
different language.
4747

48-
2. Their expressive advantage is minimal, e.g. `x++` is not much shorter
49-
than `x += 1`. The later is also more clear to a reader.
48+
2. Their expressive advantage is minimal - `x++` is not much shorter
49+
than `x += 1`.
5050

5151
3. Swift already deviates from C in that the `=`, `+=` and other assignment-like
52-
operations returns Void (for a number of reasons). These operators are
52+
operations returns `Void` (for a number of reasons). These operators are
5353
inconsistent with that model.
5454

5555
4. Swift has powerful features that eliminate many of the common reasons you'd
5656
use `++i` in a C-style for loop in other languages, so these are relatively
57-
infrequently used in well-written Swift code. These include features like
57+
infrequently used in well-written Swift code. These features include
5858
the `for-in` loop, ranges, `enumerate`, `map`, etc.
5959

6060
5. Code that actually uses the result value of these operators is often
6161
confusing and subtle to a reader/maintainer of code. They encourage "overly
6262
tricky" code which may be cute, but difficult to understand.
6363

64-
6. While Swift has well defined order of evaluation, any code that dependend on
64+
6. While Swift has well defined order of evaluation, any code that depended on
6565
it (like `foo(++a, a++)`) would be undesirable even if it was well-defined.
6666

6767
7. These operators are applicable to relatively few types: integer and floating
6868
point scalars, and iterator-like concepts. They do not apply to complex numbers,
6969
matrices, etc.
7070

71-
8. Having to support these could add complexity to the forthcoming Swift 3
71+
8. Having to support these could add complexity to the potential
7272
revised numerics model.
7373

7474
Finally, these fail the metric of "if we didn't already have these, would we add
@@ -84,18 +84,18 @@ common cases), and remove them completely in Swift 3.
8484

8585
## Alternatives considered
8686

87-
Two alternatives: we could keep them. More interesting to consider, we could
87+
Simplest alternative: we could keep them. More interesting to consider, we could
8888
change these operators to return Void. This solves some of the problems above,
8989
but introduces a new question: once the result is gone, the difference between
9090
the prefix and postfix form also vanishes. Given that, we would have to pick
91-
between unfortunate choices:
91+
between these unfortunate choices:
9292

9393
1) Keep both `x++` and `++x` in the language, even though they do the same
9494
thing.
9595

9696
2) Drop one of `x++` or `++x`. C++ programmers generally prefer the prefix
9797
forms, but everyone else generally prefers the postfix forms. Dropping either
98-
is deviating from C.
98+
one would be a significant deviation from C.
9999

100100
Despite considering these options carefully, they still don't justify the
101101
complexity that the operators add to Swift.

0 commit comments

Comments
 (0)