What is the point of the no-continue rule?
See original GitHub issueThe official ESLint docs say “When used incorrectly it makes code less testable, less readable and less maintainable.”
Does Airbnb agree with the above reasoning? If so, can you give an example of how continue
makes code less testable and less maintainable?
(I’m not arguing against it btw, just want to understand why.)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:30
- Comments:47 (4 by maintainers)
Top Results From Across the Web
Reversal Rule
If the child responds incorrectly to any of the first 3 items for the start point, then GO BACK to the previous start...
Read more >Regulation Z Truth in Lending Introduction Background and ...
Purpose of the TILA and Regulation Z. The Truth in Lending Act is intended to ensure that credit terms are disclosed in a...
Read more >Backboard LED strip rules for NCAA Basketball - Daktronics
If no, continue with the confirmation. After 30 seconds, did Red/LED lights on backboard illuminate and stay on until 0:30 entered into game ......
Read more >Civ Pro I Rule Blocks - Rules and Potential Essay topics for 1L ...
Rules and Potential Essay topics for 1L exams civil procedure rule blocks ... such that the forum can be said to can be...
Read more >Why does Lua have no "continue" statement? - Stack Overflow
The Lua authors felt that continue was only one of a number of possible new control flow mechanisms (the fact that it cannot...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
continue, like break, is GOTO. There are countless articles on the internet about GOTO being harmful.
In addition, this style guide discourages loops, which are the only places you’d need continue or break.
@MegaArman Loops are still useful in 2018 in many non trivial cases and will stay useful even in 2118, you can’t do everything with map, reduce, filter.
See the example I gave above and tell me how continue is “bouncing around” like goto is.
That’s an invalid statement, if the code already become such a mess, then not having continue and breaks won’t help you, loops shouldn’t be huge, just like functions shouldn’t be huge. Banning basic coding concepts isn’t a magic tool to make code more readable and maintainable, and oftenly can make the code even less maintainable (like more complex stopping conditions in no continue loops)