elixir-lang / elixir-lang.github.com

Website for Elixir
elixir-lang.org
354 stars 822 forks source link

Improve 'Types and Specs' introduction #1643

Closed ctstacey closed 2 years ago

ctstacey commented 2 years ago

Clarifies the statement "all types in Elixir are checked at runtime". They are not checked per say, exceptions are thrown. Thus I think it's better to say "Types are not checked at compile time".

Expands on what Types and Specs are useful for (i.e. documentation, code clarity, static code analysis).

josevalim commented 2 years ago

They are actually checked at runtime. Every time we do an operation, such as addition, we check the type and raise if they are invalid. You get exceptions as a consequence of the check :)

ctstacey commented 2 years ago

Thanks Jose, fair comment. Is there anything in the second paragraph you feel worth pulling, or shall I close the PR?

ctstacey commented 2 years ago

Thanks for considering my PR and for the feedback 👍 😃

josevalim commented 2 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: