Skip to content

Commit 409059b

Browse files
committed
contributing
1 parent aa791ce commit 409059b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

contributed/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Contributing propane examples
2+
3+
Share your enthusiasm for coding by submitting an example for inclusion here, provisional versions are acceptable if they demonstrate something interesting (and work), but we would prefer that you followed the style guide. But naturally we expect that you to aspire to the principal of code as art eventually (not many original examples survive without amendment).
4+
5+
### Style guide
6+
7+
* Prefer `Vec2D` and `Vec3D` to `PVector` (it is confusing and sometimes plain wrong).
8+
* Prefer `Struct` over `Vec2D` and `Vec3D` if you don't need their methods.
9+
* No trailing whitespace.
10+
* Use spaces not tabs.
11+
* Avoid explicit return statements.
12+
* Avoid using semicolons.
13+
* Don't use `self` explicitly anywhere except class methods (`def self.method`)
14+
and assignments (`self.attribute =`).
15+
* Prefer `&:method_name` to `{ |item| item.method_name }` for simple method
16+
calls.
17+
* Use `CamelCase` for classes and modules, `snake_case` for variables and
18+
methods, `SCREAMING_SNAKE_CASE` for constants.
19+
* Use `def self.method`, not `def Class.method` or `class << self`.
20+
* Use `def` with parentheses when there are arguments.
21+
* Don't use spaces after required keyword arguments.
22+
* Use `each`, not `for`, for iteration.
23+
24+
When translating a sketch from vanilla processing (or some other codebase), you should credit the original author, unless the rubified version is unrecognizable from the original. It is often worth running rubocop on sketch code to avoid the most egregious errors.

0 commit comments

Comments
 (0)