User Experience Guidelines#
To borrow a slogan from Elm,
Compilers should be assistants, not adversaries. A compiler should not just detect bugs, it should then help you understand why there is a bug. It should not berate you in a robot voice, it should give you specific hints that help you write better code. Ultimately, a compiler should make programming faster and more fun! Evan Czaplicki
This chapter provides guidelines on how to implement diagnostics and command-line options in ways that we hope achieve the above ideal.
- Guidelines for Diagnostics
- Talk in terms of the user’s code
- Diagnostics are actionable
- The user’s attention is important
- Sometimes the user didn’t write the code
- Precision of Wording
- Try the diagnostic on real-world code
- Make mismatches clear
- Location Information
- Coding Conventions
- Group logically-related diagnostics
- Quoting
- Spelling and Terminology
- Fix-it hints
- Guidelines for Options