processing / processing/p5.js

Style guide questions

Open
#6,607 28 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Discussion
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Topic

As we're working on example revisions, I had a few questions about the code style guide.

  1. Using single quotes for strings: This means that if a contributor is writing their code in the p5 editor and presses the Tidy Code button, they are breaking the style guide. This is true of any editor using Prettier. On my workspace, I customized Prettier to use single quotes so that I could still use it. Since there is no explanation included, I wanted to ask the reasoning for this rule. If we're sticking with it, I'd recommend the p5 editor's Tidy Code feature be modified to fit and perhaps instructions in the style guide on how to customize Prettier on other editors.
  2. Don't use for loops for iterating over arrays: This requires us to use syntax that I think is much harder to read and less accessible for folks new to programming. I would strongly advocate for using for... of loops for arrays. I would love for creators to feel able to try out iteration without learning about arrow functions, array methods, and passing anonymous functions into methods. Otherwise, we're adding a ton of steepness to the learning curve.

Tagging @nickmcintyre and @raclim for thoughts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read contributor_docs/documentation_style_guide.md and review the issue's questions about single quotes, array iteration, Prettier, and the p5 editor's Tidy Code feature. Done means the style guidance and any requested editor behavior are resolved and documented after the open discussion reaches a decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.