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

Stack is not a stack #1105

Closed
riatzukiza opened this issue Feb 23, 2018 · 6 comments
Closed

Stack is not a stack #1105

riatzukiza opened this issue Feb 23, 2018 · 6 comments

Comments

@riatzukiza
Copy link

If the stack on the app were a stack, from the following code you would expect the page to display "foo", but instead it will display "not foo".

app.use("/foo",(req,res) => res.end("not foo"));
app.use("/foo",(req,res) => res.end("foo"));

The data structure in use is a queue, if stack is the desired behavior, the index would start at the end of the array and move to the front.

@dougwilson
Copy link
Contributor

Hi @riatzukiza ! The word "stack" is just a generic English word; it is not referring to the computing concept known as a stack.

stack (noun): a pile of objects, typically one that is neatly arranged.

@riatzukiza
Copy link
Author

riatzukiza commented Feb 23, 2018

It would definitely suck to fix this, and run around change all the docs to say the correct word. Then in the process, every article written about the connect stack would become inconsistent with the documentation.

@dougwilson
Copy link
Contributor

The array is also exposed as the property named "stack" so that should change to reflect the new wording and release a new major version as well.

@dougwilson
Copy link
Contributor

As far as I know it has been called "stack" since 2010 and in those 8 years there never seemed to be confusion, especially when the same sentence explains the order of execution.

@riatzukiza
Copy link
Author

you could change the name to queue in the code, make the reference to stack a getter, and put a depreciation warning on it, and wait to completely remove it until the next time a major release is justified for other reasons. It would avoid breaking backwards compatibility.

@dougwilson
Copy link
Contributor

dougwilson commented Feb 23, 2018

Yea, but that all seems pointless and I'm not going to make the change. You're welcome to fork the module and publish a version that makes sense to you, of course. The license is MIT.

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

2 participants