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

New **link(url, [winName], [options])** method! #532

Closed
wants to merge 2 commits into from

Conversation

GoToLoop
Copy link
Contributor

* User @leota from http://Forum.Processing.org/two/discussion/8809/link-function asked for a **link()** method for "p5.js".
* It already exists in PJS @ http://ProcessingJS.org/reference/link_/.
* Also in "Java Mode". But it's currently undocumented.
* I believe **link()**'s implementation in "p5js" was skipped somehow.
* So here it is! And it's now even more powerful w/ the extra Window features optional parameter ;-)
@brysonian
Copy link
Contributor

I think "link" is not a very good name for this, it is really unclear what the function would do, make an a tag? open a window? open a URL in the current window? i think the act of "linking" is making a connection, not creating a window or moving the user to a new location. It's also just reproduces the behavior of window.open with a slightly different argument list which is strange.

@GoToLoop
Copy link
Contributor Author

  • Well, most of Processing's API is merely wrappers for native functions for the current flavor.
  • In p5*js's case it is JavaScript!
  • Just bringing in to p5*js 1 more function which already exists in Processing and its many "modes".
  • For familiarity's sake, it's much more preferable to keep the original name.
  • This way, folks which use other Processing's flavors won't suffer that much when trying p5*js out!

@brysonian
Copy link
Contributor

"Most" is a stretch, but either way that doesn't mean the project should reproduce poorly named functions in processing.js. That's part of the joy of p5js not being a port, but a reinterpretation. openURL is far clearer and avoids potential confusion, that doesn't mean we couldn't redirect the doc entry for "link" though.

@GoToLoop
Copy link
Contributor Author

  • That's why I said it's more preferable. Some API got names changed in p5*js. But not that many!
  • If you read the link from Processing's forum I left, you're gonna realize that most folks wish familiarity.
  • Keeping the original names makes the transition from Java (or other P5 flavor) to p5*js much easier!

@brysonian
Copy link
Contributor

well i can't very well respond to things in an edited comment can i ;) And yes i did read the link and see that one person wants familiarity, but for my part i'm not convinced that is sufficient.

@lmccart
Copy link
Member

lmccart commented Feb 12, 2015

@GoToLoop: as @brysonian points out, the goal is to create a reinterpretation of Processing rather than a port. It is not to make a port or reimplementation or processing.js, so we are not concerned that the two fit perfectly together. Hopefully we can learn from it and make things even better. I think openURL() makes sense and aligns somewhat with Processing's open() method. I'm not totally convinced we need a wrapper on window.open(), there are so many window properties and functions we could wrap.

In the future, it would be best if you could raise an issue and we could discuss the need and implementation of a new method before submitting a PR. (See the notes under implementing a new feature here.)

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

Successfully merging this pull request may close these issues.

None yet

3 participants