processing/processing-web-archive

Wrong Link for set() method

Closed this issue · 7 comments

http://processing.org/reference/PVector.html

There are two link items of set() in Method section. While they seems the same one.

GKFX commented

set(float,float) is technically a different method to set(float,float,float), so it is quite rational. Also, it's nice to see different options laid out differently.

I know they are different implementation indeed. But the Processing Reference is written in different way from Java Doc. Processing Reference treats methods of the same name as one, though they may have different parameter modes. The difference of parameters will be show in the method reference page, while they still seem the same method.

In fact, set() has more than two kinds of parameter mode, as described in http://processing.org/reference/PVector_set_.html.

Processing tends to be easy to understand. It is better to hide unnecessary technical details that we won't explain in this simple reference.

GKFX commented

If there are four versions it seems misleading to show two, and four is excessive. One seems best, especially since it's standard practice. (Hadn't occurred to me previously.)
Although in fairness, there are no unnecessary technical detains on the page at the moment, just the two most simple invocations.

I noticed this too and had some of the same thoughts as mentioned here. I did some digging though in the source code history. The 2 parameter set method was added by @shiffman on Mar 17, 2013 with this commit and so was the web reference to it.

I think including the explicit web reference to the 2 parameter variant (against standard practice to just mention the method as such) has some reasoning to it in the sense that:

  • this variant was only added 'relatively recently'
  • has long been missed by many people using PVector
  • especially the PVector-beginners that start in 2D (and used to be forced to use a 3D method)

So it may be the conscious choice of a little extra advertising given the history of this method and the fact that it will be a very often used method, especially with PVector-2D-beginners.

I think both options (stay or go) are viable. Since I don't know which option is the desired solution, I haven't sent a pull request with a fix for this issue.

@shiffman can you weigh in?

GKFX commented

Makes sense either way I suppose. I have no particular preference.

Thanks for all of these great thoughts! Thinking this over I think it's best to just have the one listing. It could say: "Set the components of the vector." How does this sound?

That would make sense and is a suitable conclusion to the above discussion.

I have sent a pull request with the changes.