Skip to content

Comments

consistent variable names in definition as well as function argument#151

Closed
dmytro-kerest wants to merge 1 commit intoryanmcdermott:masterfrom
dmytro-kerest:master
Closed

consistent variable names in definition as well as function argument#151
dmytro-kerest wants to merge 1 commit intoryanmcdermott:masterfrom
dmytro-kerest:master

Conversation

@dmytro-kerest
Copy link

Found the inconsistencies in the example in variable definition and functionaargument

@vsemozhetbyt
Copy link
Contributor

This was changed intentionally in #97.

@ryanmcdermott
Copy link
Owner

@vsemozhetbyt Should we change this back? This seems to be getting a steady stream of PRs trying to change it to its original form.

@vsemozhetbyt
Copy link
Contributor

@ryanmcdermott Yeah, there are five ones at least according to references in the #97. I see three possible fixes:

  1. Add a function call after the variable and function declaration. However, this could reduce confusion not enough.
  2. Delete the variable declaration. Add a function call after the function declaration with object literal as an argument. This could be less readable.
  3. Revert the fix and return the shadowing. This could be confusing for other users an could teach questionable naming scheme.

Please, do whatever you think is more preferable.

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Jan 17, 2017

Also, we can make both names more different: config and options, for example. But this can slightly contradict the 'Use the same vocabulary for the same type of variable' part.

@ryanmcdermott
Copy link
Owner

I think the only halfway decent choice is option 2! It's not perfect in terms of readability, but it will prevent people from doing two other worse things which are variable shadowing and trying to change this back.

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Jan 18, 2017

bluesven869 added a commit to bluesven869/clean-code-javascript that referenced this pull request Aug 25, 2020
Jordan-2113 pushed a commit to Jordan-2113/CLEAN-CODE-JAVASCRIPT that referenced this pull request Oct 23, 2023
Jordan-2113 added a commit to Jordan-2113/widget-up that referenced this pull request Dec 20, 2023
likenstavares5 added a commit to likenstavares5/clean-code-javascript that referenced this pull request Sep 20, 2025
Ju7k6ykonePan9twkey added a commit to Ju7k6ykonePan9twkey/clean-code-javascript that referenced this pull request Sep 29, 2025
iskcebnuum3132 added a commit to iskcebnuum3132/clean-code-javascript that referenced this pull request Sep 30, 2025
JarlhfedRound768s added a commit to JarlhfedRound768s/clean-code-javascript that referenced this pull request Sep 30, 2025
Kaxn5hz4ga65renColeie73vyor4eman added a commit to Kaxn5hz4ga65renColeie73vyor4eman/clean-code-javascript that referenced this pull request Sep 30, 2025
Wiiackc5fgo5lliamDavz3pzis added a commit to Wiiackc5fgo5lliamDavz3pzis/clean-code-javascript that referenced this pull request Sep 30, 2025
Ernestzixplz9Winf64kler added a commit to Ernestzixplz9Winf64kler/clean-code-javascript that referenced this pull request Oct 2, 2025
buildwithria pushed a commit to buildwithria/clean-code-javascript that referenced this pull request Oct 2, 2025
chadmuellerboyceconner0 added a commit to chadmuellerboyceconner0/clean-code-javascript that referenced this pull request Oct 2, 2025
christianaaaralynJoanMacdonald added a commit to christianaaaralynJoanMacdonald/clean-code-javascript that referenced this pull request Oct 2, 2025
vildosolacaroll1-83 added a commit to vildosolacaroll1-83/clean-code-javascript that referenced this pull request Oct 3, 2025
marynsandovl added a commit to marynsandovl/clean-code-javascript that referenced this pull request Oct 3, 2025
mrspatriciaadamskieronloretta added a commit to mrspatriciaadamskieronloretta/clean-code-javascript that referenced this pull request Oct 8, 2025
LisaClayton5686794 added a commit to LisaClayton5686794/clean-code-javascript that referenced this pull request Oct 8, 2025
537ysb1igc2844 added a commit to 537ysb1igc2844/clean-code-javascript that referenced this pull request Oct 8, 2025
mrmichaeltylerdvm7248karenmartin added a commit to mrmichaeltylerdvm7248karenmartin/clean-code-javascript that referenced this pull request Oct 8, 2025
CurtisDukecldhf08 added a commit to CurtisDukecldhf08/clean-code-javascript that referenced this pull request Oct 8, 2025
janellacaden2284tamaraolson added a commit to janellacaden2284tamaraolson/clean-code-javascript that referenced this pull request Oct 8, 2025
LoriStarkDDSahrpcsjerry added a commit to LoriStarkDDSahrpcsjerry/clean-code-javascript that referenced this pull request Oct 8, 2025
angelaelliott40582angelaelliott added a commit to angelaelliott40582angelaelliott/clean-code-javascript that referenced this pull request Oct 8, 2025
bdlbf05872670kimberlywilson added a commit to bdlbf05872670kimberlywilson/clean-code-javascript that referenced this pull request Oct 8, 2025
adamdavis52287adamdavis added a commit to adamdavis52287adamdavis/clean-code-javascript that referenced this pull request Oct 8, 2025
MichaelSutton5454635 added a commit to MichaelSutton5454635/clean-code-javascript that referenced this pull request Oct 8, 2025
ScottHerman6780GaryHuerta added a commit to ScottHerman6780GaryHuerta/clean-code-javascript that referenced this pull request Oct 8, 2025
fprmtn22998jordanwhitaker added a commit to fprmtn22998jordanwhitaker/clean-code-javascript that referenced this pull request Oct 10, 2025
dojdj6461690dustinsingh added a commit to dojdj6461690dustinsingh/clean-code-javascript that referenced this pull request Oct 11, 2025
vrovt5524461 added a commit to vrovt5524461/clean-code-javascript that referenced this pull request Oct 16, 2025
obtzzw2343610 added a commit to obtzzw2343610/clean-code-javascript that referenced this pull request Oct 16, 2025
jbattle8831-e added a commit to jbattle8831-e/clean-code-javascript that referenced this pull request Oct 16, 2025
cordeverr1 added a commit to cordeverr1/clean-code-javascript that referenced this pull request Oct 19, 2025
ukgburr33 added a commit to ukgburr33/clean-code-javascript that referenced this pull request Oct 19, 2025
97carolynwilkerson69 added a commit to 97carolynwilkerson69/clean-code-javascript that referenced this pull request Oct 19, 2025
marbiblerv8 added a commit to marbiblerv8/clean-code-javascript that referenced this pull request Oct 19, 2025
cbilodeau-davidj added a commit to cbilodeau-davidj/clean-code-javascript that referenced this pull request Oct 20, 2025
vjohngjackson added a commit to vjohngjackson/clean-code-javascript that referenced this pull request Oct 20, 2025
te6481-4 added a commit to te6481-4/clean-code-javascript that referenced this pull request Oct 20, 2025
mark0vjohnsoo added a commit to mark0vjohnsoo/clean-code-javascript that referenced this pull request Oct 20, 2025
tshort-robertd added a commit to tshort-robertd/clean-code-javascript that referenced this pull request Oct 20, 2025
richbonnie2-38 added a commit to richbonnie2-38/clean-code-javascript that referenced this pull request Oct 20, 2025
jamessocjonesr added a commit to jamessocjonesr/clean-code-javascript that referenced this pull request Oct 20, 2025
aharvey8558-b added a commit to aharvey8558-b/clean-code-javascript that referenced this pull request Oct 20, 2025
tchestnut-271bo added a commit to tchestnut-271bo/clean-code-javascript that referenced this pull request Oct 20, 2025
ert96-kw added a commit to ert96-kw/clean-code-javascript that referenced this pull request Oct 26, 2025
nelsondeborah5-96 added a commit to nelsondeborah5-96/clean-code-javascript that referenced this pull request Oct 26, 2025
emeecham-ralphb added a commit to emeecham-ralphb/clean-code-javascript that referenced this pull request Oct 26, 2025
esenethavilouk-derekt added a commit to esenethavilouk-derekt/clean-code-javascript that referenced this pull request Oct 26, 2025
jc3976-j added a commit to jc3976-j/clean-code-javascript that referenced this pull request Oct 26, 2025
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.

3 participants