Design
This commit is contained in:
parent
564c6ed1a2
commit
8eaf7868c4
26
Design.md
26
Design.md
@ -1,6 +1,26 @@
|
|||||||
# Readability
|
# Design Goals
|
||||||
|
|
||||||
## Turbofish and inference
|
1. Intuitive and ergonomic
|
||||||
|
|
||||||
|
API should state the intention clearly. Provide syntax sugar for common things.
|
||||||
|
|
||||||
|
2. Fast(er) compilation
|
||||||
|
|
||||||
|
Balance between compile-time checking and compilation speed.
|
||||||
|
|
||||||
|
3. Avoid 'symbol soup'
|
||||||
|
|
||||||
|
Avoid macros with DSL, use derive macros where appropriate. Be friendly with IDE tools.
|
||||||
|
|
||||||
|
## Test Time
|
||||||
|
|
||||||
|
After some bitterness we realized it is not possible to capture everything compile time. But we don't
|
||||||
|
want to encounter problems at run time either. The solution is to perform checking at 'test time' to
|
||||||
|
uncover problems. These checks will be removed at production so there will be no run time penalty.
|
||||||
|
|
||||||
|
## Readability
|
||||||
|
|
||||||
|
### Turbofish and inference
|
||||||
|
|
||||||
Consider the following method:
|
Consider the following method:
|
||||||
```rust
|
```rust
|
||||||
@ -31,7 +51,7 @@ then the Turbofish can be omitted:
|
|||||||
```
|
```
|
||||||
provided that `fruit::Entity` is a unit struct.
|
provided that `fruit::Entity` is a unit struct.
|
||||||
|
|
||||||
## Builder pattern
|
### Builder pattern
|
||||||
|
|
||||||
Instead of:
|
Instead of:
|
||||||
```rust
|
```rust
|
||||||
|
22
README.md
22
README.md
@ -35,24 +35,4 @@ Use mock connections to write unit tests for your logic.
|
|||||||
|
|
||||||
4. API oriented
|
4. API oriented
|
||||||
|
|
||||||
Quickly build search models that help you filter, sort and paginate data in APIs.
|
Quickly build search models that help you join, filter, sort and paginate data in APIs.
|
||||||
|
|
||||||
## Design Goals
|
|
||||||
|
|
||||||
1. Intuitive and ergonomic
|
|
||||||
|
|
||||||
API should state the intention clearly. Provide syntax sugar for common things.
|
|
||||||
|
|
||||||
2. Fast(er) compilation
|
|
||||||
|
|
||||||
Balance between compile-time checking and compilation speed.
|
|
||||||
|
|
||||||
3. Avoid 'symbol soup'
|
|
||||||
|
|
||||||
Avoid macros with DSL, use derive macros where appropriate. Be friendly with IDE tools.
|
|
||||||
|
|
||||||
## Test Time
|
|
||||||
|
|
||||||
After some bitterness we realized it is not possible to capture everything compile time. But we don't
|
|
||||||
want to encounter problems at run time either. The solution is to perform checking at 'test time' to
|
|
||||||
uncover problems. These checks will be removed at production so there will be no run time penalty.
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user