Skip to content
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

[Discussion] Supporting Both p5py and Processing APIs #280

Closed
arihantparsoya opened this issue Sep 19, 2020 · 4 comments · Fixed by #285
Closed

[Discussion] Supporting Both p5py and Processing APIs #280

arihantparsoya opened this issue Sep 19, 2020 · 4 comments · Fixed by #285

Comments

@arihantparsoya
Copy link
Member

https://discourse.processing.org/t/api-compatibility-for-p5py/20492

Its possible for p5py to support both APIs of p5py and Processing by simply copying existing functions into new objects with different name:

mousePressed = mouse_pressed
mouseX = mouse_X
...

My idea is to keep both the APIs in p5py. Over time, through online discussions and peoples feedback, we can settle on which one users prefer.

Technically its quite simple task. And I believe it would make a lot of people happy.

@tushar5526
Copy link
Member

Yes, this will be a better solution.

@abhikpal
Copy link
Member

Since we eventually want to standardize the API with the other processing dialects, this seems like a reasonable change to me.

My idea is to keep both the APIs in p5py. Over time, through online discussions and peoples feedback, we can settle on which one users prefer.

Also a very good idea. It also doesn't seem too much work to continue supporting both versions of the API.

@jeremydouglass
Copy link
Contributor

This is a great idea!

Many of the changes will be remapping underscores to internal caps (snake_case to camelCase), so I wouldn't anticipate collisions. However, it might make sense to have one set of mappings as an explicit import, and one as the default. A big selling point of p5py is that you can use it in your python environment of choice with your tooling of choice, and having only one version of the API loaded in at a time would make the namespace cleaner and the tooling cleaner to use -- e.g. code completion on IDEs et cetera.

@tushar5526
Copy link
Member

I would like to work on this during hacktoberfest !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants