Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/content/language/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ detects these potential errors at compile time.

For example, say you want to find the absolute value of an `int` variable `i`.
If `i` is `null`, calling `i.abs()` causes a null dereference error.
In other languages, trying this could lead to a runtime error,
but Dart's compiler prohibits these actions.
Therefore, Dart apps can't cause runtime errors.
In other languages, trying this could lead to a runtime error.
Dart's compiler prevents this error by prohibiting these actions.
Comment on lines +61 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a great clarification that removes the previous overstatement. To make the benefit of null safety even clearer, you could consider rephrasing to explicitly mention that this check happens at compile time. This would reinforce the point made just before the example.

Suggested change
In other languages, trying this could lead to a runtime error.
Dart's compiler prevents this error by prohibiting these actions.
In other languages, trying this could lead to a runtime error.
With null safety, Dart reports this potential error at compile time.


Null safety introduces three key changes:

Expand Down