From 031f8dfd1176d76f29146e52be9e4b38e28b6974 Mon Sep 17 00:00:00 2001 From: StephenVavasis Date: Sat, 3 Mar 2018 13:21:07 -0500 Subject: [PATCH] FIx intro to manual chapter on types The paragraph I edited in this chapter of the manual on types confused me when I was a Julia newbie, and I still find it confusing. How do type annotations simplify a program? Improve performance? I rewrote it to state the purpose of type annotations more accurately, --- doc/src/manual/types.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/src/manual/types.md b/doc/src/manual/types.md index c64215b7a9203..6fc06ca3f4bbb 100644 --- a/doc/src/manual/types.md +++ b/doc/src/manual/types.md @@ -16,10 +16,11 @@ of function arguments to be deeply integrated with the language. Method dispatch detail in [Methods](@ref), but is rooted in the type system presented here. The default behavior in Julia when types are omitted is to allow values to be of any type. Thus, -one can write many useful Julia programs without ever explicitly using types. When additional +one can write many useful Julia functions without ever explicitly using types. When additional expressiveness is needed, however, it is easy to gradually introduce explicit type annotations -into previously "untyped" code. Doing so will typically increase both the performance and robustness -of these systems, and perhaps somewhat counterintuitively, often significantly simplify them. +into previously "untyped" code. Adding annotations serves three primary purposes: to take advantage +of Julia's powerful multiple-dispatch mechanism, to improve human readability, and to catch +programmer errors. Describing Julia in the lingo of [type systems](https://en.wikipedia.org/wiki/Type_system), it is: dynamic, nominative and parametric. Generic types can be parameterized, and the hierarchical