webextensions-examples icon indicating copy to clipboard operation
webextensions-examples copied to clipboard

Illustrative function name

Open s-c-p opened this issue 9 months ago • 1 comments

updateActiveTab has ambiguous meaning, most prominent of which doesn't mean what we are actually trying to do.

Description

updateActiveTab has ambiguous meaning, most prominent interpretation of which is not what we are actually doing in the function body.

Motivation

I know JS as server-side engineer (we have very pedantic rules on where we are allowed to change state), in this succinct but cool sample code, the flow-of-control is slightly confusing (if we don't know browser event loop) and I guess descriptive function names would reduced the confusion for new comers, the author had context and experience, but for newbies updateActiveTab would mean perhaps we are modifying something on page. Reading function def would clear the misconception, but add mental burden.

Additional details

Related issues and pull requests

s-c-p avatar May 11 '24 04:05 s-c-p

It looks like this is your first pull request. 🎉 Thank you for your contribution! One of the project maintainers will triage and assign the pull request for review. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

github-actions[bot] avatar May 11 '24 04:05 github-actions[bot]

Congratulations on your first merged pull request. 🎉 Thank you for your contribution! Did you know we have a project board with high-impact contribution opportunities? We look forward to your next contribution.

github-actions[bot] avatar Jul 13 '24 02:07 github-actions[bot]