processing / processing/processing-website

Compound assignment expressions described as being equivalent to statements

Open
#362 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
MDX
Stars
90
Forks
122
Avg merge
1h 43m
Merged PRs (30d)
3

Description

Issue description

The reference has the following to say on += :

Combines addition with assignment. The expression a+=b is equivalent to a=a+b.

The biggest problem is that the expression a+=b has a return value (namely a+b), so it
can be used as a part of a larger expression. The statement a=a+b has no return value
and can not be used as part of a larger expression>

As a smaller problem a+=b involves an implicit cast, but that belongs to the detail department.

For students learning to program, it is important to be clear about the distinction between
expressions and statements, so I suggest a rewording that makes it clear that a+=b
is an expression.

URL(s) of affected page(s)

https://processing.org/reference/addassign.html

Proposed fix

Contributor guide

No contributing guide indexed for this repository

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

Open the affected reference page at processing.org/reference/addassign.html and review the wording for +=. Update the description so it distinguishes the compound-assignment expression from the assignment statement, including its return value; note the implicit cast as a secondary detail.】【。

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.