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

Use parameters consistently. #2051

Open
ioquatix opened this issue Mar 13, 2023 · 0 comments
Open

Use parameters consistently. #2051

ioquatix opened this issue Mar 13, 2023 · 0 comments

Comments

@ioquatix
Copy link
Member

ioquatix commented Mar 13, 2023

RFCs all typically refer to it as "parameters". Even Rails tends to use parameters, as in ActionDispatch::Request#query_parameters and ActionDispatch::Request#request_parameters. I'm sure there are other examples. A cursory glance at params vs parameters shows that parameters is more commonly used.

Even in Rack itself, we have mixed usage.

I'd like to propose we try to make this part of the interface more consistent.

In regards to general consistency, and something that is probably hard to change, parameters or formal parameters normally refers to the variables in a function/method definition, not the actual values, which are typically referred to as arguments. It's interesting that we've somehow managed to blur the lines here w.r.t. web technology/terminology. In that way of thinking, for example, I'd say request.arguments => [1, "John", 20] and request.parameters => [:user_id, :name, :age] would be a more appropriate taxonomy.

As a separate issue, maybe we can talk about Rack::Request#params, Rack::Request#[] and the fact that Rack::Request#get_header doesn't actually return headers and is inconsistent with other parts of Rack. It might be good to figure out a bigger "plan of attack" for the evolution of Rack (or not).

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

No branches or pull requests

1 participant