-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default values of arguments #6721
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you! |
Great find @mohitbalwani! This code was introduced in commit 4102551, which dates to 2017. Setting default values in this way was common until ECMASCRIPT 2015 (aka ES6), which was the specification that introduced many of the features we now refer to as "modern JavaScript," including default parameters. It took developers some time to adopt the new features. For example, here's an article from 2018 that still refers to these features as "new." So, I suspect this usage is a result of developers not being familiar with the new syntax, or wanting to maintain consistency with the old approach. We're just starting work toward p5.js 2.0, and one of the goals is to thoroughly modernize the p5.js codebase. The issue you found would likely be a part of that effort. I'll go ahead and link to your issue from the main discussion about p5.js 2.0, which is happening in #6678, so that we can figure out the best way to proceed. |
Thanks for the detailed explanation @GregStanton! I'm excited about the ongoing work on p5.js 2.0 and would love to contribute to the modernization effort. If there's any specific guidance or tasks related to this issue that I can help with, please let me know. Looking forward to being a part of the progress! |
I'm glad to help @mohitbalwani! To get started, you could read my informal modernization proposal and then indicate whether you're interested in leading that effort or whether you'd like to work on specific tasks like the one you identified. If you want to lead the effort and help volunteers to contribute, I suggest that you write up a detailed proposal indicating the types of modernizations you propose and how you would break up the work into manageable tasks. However, do note that we're currently figuring out a new issue template for the p5.js 2.0 proposals, and it will be easier to make the proposal once that template is available. If you prefer to start immediately, you're still welcome to submit a proposal now; in that case, I would use the Existing Feature Enhancement issue template. |
Thank you, @GregStanton! I'm excited about the idea of leading the effort to modernize p5.js codebase. I'll start by reading your informal proposal and then work on a detailed proposal outlining the modernization plan. I agree that breaking it down into sub-issues will make it more manageable. I'll keep an eye on the new issue template for p5.js 2.0 proposals and ensure that the proposal aligns with the community's goals. Looking forward to contributing to this important initiative! |
That's fantastic @mohitbalwani! I'm looking forward to seeing what you put together! |
Hi @mohitbalwani! The new issue form for p5.js 2.0 proposals is live! |
Hery @GregStanton I wanted to know what skills should I have in order to contribute in something as big as changing from p5.js to p5.js 2.0 ? |
Hi @vaishnavi192! Thanks for your question! The same skills that are usually helpful will also be helpful for p5.js 2.0. No special expertise is required. Here are some skills that are generally helpful:
Here a couple of specific ways to help:
Note that the list of current proposals is maintained at the top of issue #6678. I expect more proposals will get added as people continue to use the p5.js 2.0 proposal form. I hope that helps! |
Hi @mohitbalwani! Are you still planning to submit a proposal to modernize syntax in the p5.js codebase? As a reminder, the informal idea is outlined in this comment. It's totally fine if you're too busy or if you need some more time. I just thought I'd check in, since if you won't be able to work on this, I can submit the proposal or else find another contributor who'd like to do it. |
@GregStanton Thanks for the great explanation! Rn I have medium level proficiency in js. Currently gaining more understanding about p5.js and js. So, like as you mentioned in #6767 issue above in comments, how can I help them as a beginner, I have to tell them my reviews as a beginner? |
@GregStanton I will submit proposal very soon. I apologize for the delay in my response, I was traveling/vacationing and just returned back. |
Hi @vaishnavi192! That's a good question. If you read over issue #6767 and some of the comments, you'll see that "beginners" are mentioned quite frequently. That's because we're trying to guess what will be hard for beginners to understand. So, one way to help is to make a comment saying something like "Hi! I noticed you've all been trying to determine what's easiest for beginners. I'm kind of a beginner and know some JavaScript, but I don't have experience with You might try something similar with a couple of other issues and see if anyone takes you up on your offer. A quick way to figure out if you can help in this way is to use I hope that helps! Let me know if you have any other questions :) |
Hi @mohitbalwani! No worries! Take your time. I just wanted to ask in case you had moved on to something else. |
@GregStanton Yes I got it coz of your detailed explanation. Thanks, will try to help for sure! |
Topic
I noticed that the default values for arguments are being set using if ladders. I think we can pass the defaults in the function's parameters itself to save lots of lines of code. But before jumping into making those changes I wanted to know the reason behind setting them like that. What do you think about changing the way of setting the default values?
The text was updated successfully, but these errors were encountered: