mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-28 16:10:55 +00:00
c1fe42fede
When handling special cases that are logically distinct from the function's main branch, it improves code quality (through readability and maintainability) to place those first and with an early return. The has the benefit of the main return statement being easy to find at the end of the function. (Not early and/or in a block). It also means when working on the code, there is generally a less complexity and fewer nesting levels, given that most code is in the main branch. This makes is easier and quicker to verify that code does what it should, as well as making it easy to extend in the future. When considering to add code to end of a function's main scope, it should relate to the function's main branch by default, not a special case. For example, a getName() method should not end with a top-level statement 'return false' (unless it is a stub). Rather, one would expect it to end with `return name`. Change-Id: I1f3088f2409c82dd3bf757fc8fa27dc97ae2767b |
||
---|---|---|
.. | ||
skins.minerva.backtotop | ||
skins.minerva.base.reset | ||
skins.minerva.base.styles | ||
skins.minerva.categories | ||
skins.minerva.content.styles | ||
skins.minerva.content.styles.images | ||
skins.minerva.editor | ||
skins.minerva.icons.images | ||
skins.minerva.icons.images.scripts | ||
skins.minerva.icons.images.scripts.misc | ||
skins.minerva.icons.images.variants | ||
skins.minerva.icons.loggedin | ||
skins.minerva.icons.page.issues.default.color | ||
skins.minerva.icons.page.issues.medium.color | ||
skins.minerva.icons.page.issues.uncolored | ||
skins.minerva.loggedin.styles | ||
skins.minerva.mainMenu | ||
skins.minerva.mainMenu.icons | ||
skins.minerva.mainMenu.styles | ||
skins.minerva.mainPage.styles | ||
skins.minerva.newusers | ||
skins.minerva.notifications | ||
skins.minerva.notifications.badge | ||
skins.minerva.scripts | ||
skins.minerva.scripts.top | ||
skins.minerva.tablet.scripts | ||
skins.minerva.tablet.styles | ||
skins.minerva.talk | ||
skins.minerva.toggling | ||
skins.minerva.userpage.icons | ||
skins.minerva.userpage.styles | ||
skins.minerva.watchstar |