You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some examples seem rather repetitive, such as the second example here, which is more complicated that the initial example but not much simpler (one less argument) than the third.
I believe that examples should demonstrate something new and generally increase in complexity, though I'm not sure if this is the consensus of the community.
Is it worth combing through and looking for extraneous examples?
The text was updated successfully, but these errors were encountered:
Hi @sambensim ! In that particular example, though, the second example demonstrates usage with a callback and without the error handling, which might be helpful to show that the parameters are optional.
Tagging documentation steward @perminder-17 - p5.js uses optional parameters widely, do you have a sense of whether it's useful to have the multiple usages demonstrated, or if there's some other way to make optional parameter use really understandable and tangible for beginners?
Thank you very much for sharing these examples. In my view, both snippets demonstrate distinct and valuable approaches, so having both examples is quite beneficial rather than problematic. The first example illustrates the well-established preload + setup pattern, which ensures that the image is fully loaded before any drawing operations occur, while the second example highlights the callback approach by invoking loadImage() directly within setup() and reacting immediately once loading completes. Each snippet therefore conveys a separate technique, one for guaranteed preloading and the other for on-the-fly loading with a callback. wihtout causing confusion. If additional clarity is desired, we could certainly include further illustrations, but these two already capture the primary options in a clear and concise manner. Thank you again for your thoughtful consideration.
@ksen0 I think the two examples we have strike a good balance but multiple demonstrations of exmples are always appriciated. To make optional parameters even clearer for beginners, we could (1) add brief inline comments in the snippets and (2) add a short “Optional Parameters” note in the Foundations section explaining that p5.js follows standard JavaScript behaviour.
Topic
Some examples seem rather repetitive, such as the second example here, which is more complicated that the initial example but not much simpler (one less argument) than the third.
I believe that examples should demonstrate something new and generally increase in complexity, though I'm not sure if this is the consensus of the community.
Is it worth combing through and looking for extraneous examples?
The text was updated successfully, but these errors were encountered: