Skip to content
Permalink
Browse files

Add misc style points (#1784)

* [style] Use proper English sentences for comments

* [style] Trailing floating points
  • Loading branch information...
odow authored and mlubin committed Jan 16, 2019
1 parent bd857dd commit 21c7a09d45a8c50f359ab3e5d4ceeae4197cffc6
Showing with 20 additions and 2 deletions.
  1. +20 −2 docs/src/style.md
@@ -164,8 +164,26 @@ empty vector with element type `T`. Prefer `T[]` because it is more concise.

#### Trailing periods in floating-point constants

Both `1.0` and `1.` create a `Float64` with value `1.0`. Prefer `1.0` over
`1.` because it is more easily distinguished from the integer constant `1`.
Both `1.0` and `1.` create a `Float64` with value `1.0`. Prefer `1.0` over `1.`
because it is more easily distinguished from the integer constant `1`.

Moreover, as recommended by the [Julia style guide](https://docs.julialang.org/en/v1/manual/style-guide/index.html#Avoid-using-floats-for-numeric-literals-in-generic-code-when-possible-1),
never use `1.0` when `1` is okay.

#### Comments

For non-native speakers and for general clarity, comments in code must be proper
English sentences with appropriate punctuation.

Good:
```julia
# This is a comment demonstrating a good comment.
```

Bad:
```julia
# a bad comment
```

### Naming

0 comments on commit 21c7a09

Please sign in to comment.
You can’t perform that action at this time.