question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is the point of the no-continue rule?

See original GitHub issue

The 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:closed
  • Created 7 years ago
  • Reactions:30
  • Comments:47 (4 by maintainers)

github_iconTop GitHub Comments

185reactions
ljharbcommented, Oct 4, 2016

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.

62reactions
SelaOcommented, Jun 27, 2018

@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.

but imagine working on a large codebase with lots of loops and if statements with continues scattered about

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found