Skip to content

Commit 477f29a

Browse files
cfredricChromium LUCI CQ
authored and
Chromium LUCI CQ
committed
Swap strong/weak typing for static/dynamic typing.
This is as pedantic as nits get, but according to Wikipedia, strong/weak typing doesn't have a precise definition, whereas static/dynamic typing is clearly defined. We might as well refer to the clearly-defined concepts here. Anecdotally, I've heard "strong/weak" used to refer to a language's willingness to do implicit coersions. E.g., `1 + "1"` is valid in JavaScript, but invalid in Python; so Python is more strongly-typed than JavaScript, even though both are dynamically-typed (ignoring the new optional type annotations in Python, and Closure-flavored JavaScript). Change-Id: I23ae6441fde7a29617b2cf00f588fdf1cfda0c2b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3213286 Reviewed-by: Dirk Pranke <[email protected]> Commit-Queue: Dirk Pranke <[email protected]> Auto-Submit: Chris Fredrickson <[email protected]> Cr-Commit-Position: refs/heads/main@{#929474}
1 parent b42abc4 commit 477f29a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/closure_compilation.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## What is type safety?
44

5-
[Strongly-typed languages](https://en.wikipedia.org/wiki/Strong_and_weak_typing)
5+
[Statically-typed languages](https://en.wikipedia.org/wiki/Type_system#Static_type_checking)
66
like C++ and Java have the notion of variable types.
77

88
This is typically baked into how you declare variables:
@@ -24,12 +24,12 @@ you if there's no sane default action to take.
2424
Typing can also be manually annotated via mechanisms like `dynamic_cast` and
2525
`static_cast` or older C-style casts (i.e. `(Type)`).
2626

27-
Using stongly-typed languages provide _some_ level of protection against
27+
Using statically-typed languages provides _some_ level of protection against
2828
accidentally using variables in the wrong context.
2929

30-
JavaScript is weakly-typed and doesn't offer this safety by default. This makes
31-
writing JavaScript more error prone, and various type errors have resulted in
32-
real bugs seen by many users.
30+
JavaScript is dynamically-typed and doesn't offer this safety by default. This
31+
makes writing JavaScript more error prone, and various type errors have resulted
32+
in real bugs seen by many users.
3333

3434
## Chrome's solution to typechecking JavaScript
3535

0 commit comments

Comments
 (0)