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

Code optimization: accept objects as function parameters #99

Open
rahulbhanushali opened this issue Feb 21, 2015 · 1 comment
Open

Code optimization: accept objects as function parameters #99

rahulbhanushali opened this issue Feb 21, 2015 · 1 comment

Comments

@rahulbhanushali
Copy link

Its really difficult to pass parameters to the functions as the parameters are defined individually.

For example the method search has 6 to 7 parameters and I want to only pass the first and 6th parameter then I will have to pass

search(param1, undefined, undefined, undefined, undefined, undefined, param6);

These is really very inconvenient as one will have to pass unecessary parameters with value undefined.

Using objects here would be very handy as one could simple code its something like as follows

var params = {
param1: value,
param6: value
};
search(params);

The code is short and readable.

@floralvikings
Copy link
Contributor

This would break backwards compatibility for anyone currently using this library without a lot of code in place to check for the old multiple-parameter style functions being used; that's a lot of work for a style issue.

Full Disclosure: I wrote and maintain the following library; if you'd prefer single-parameter functions, you might want to check it out: https://www.npmjs.com/package/jira-connector

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