-
Notifications
You must be signed in to change notification settings - Fork 6
Expressive Literals
Shane Brinkman-Davis Delamore edited this page Mar 29, 2018
·
5 revisions
CaffeineScript's powerful, expressive literals allow you to construct complex data-structures in a way that mirrors your data, rather than disfiguring your data because of the constraints of the language. The goal is to be able to create data-structures which are easy to read. To do this, we need to apply graphical design:
- proximity: authors can communicate the relatedness of things by putting them near each other
- alignment: Alignment is another way to show what is related to what. It also makes it easy to ignore parts that aren't currently relevant.
- whitespace: balance of white-space to content is important for easy reading
- contrast:
- repetition: specifically, repetition of form allows the coder to communicate to the reader what data structures have the same form, vs structures which differ
Alignment is key to presenting data in an easy-to-read way. As such, the CaffeineScript-literals are designed to work well in columns and rows, with indentation to establish hierarchical relationships. Visual clutter, symbols, keywords and formatting have been virtually eliminated, to allow you to express your data in the cleanest way possible.
- Array Literals
- Object Literals
- String Literals
- Object Structuring
- Object and Array Destructuring
- Home
- Get Started
- Benefits
- Highlights
- Productivity by Design
- CaffeineScript Design
- What is CaffeineScript Good For?
- Get the most out of JavaScript
- Language Comparison
- CHANGELOG
- Blocks Instead of Brackets
- Binary Line-Starts
- Everything Returns a Value
- Streamlined Modules
- Scopes and Variables
- Optional Commas
- Semantics
- Ambiguities