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.

Pseudocode "Break" Omission

See original GitHub issue

Challenge Adding a default option in Switch statements

In this challenge’s pseudocode it does omits the “break;” statement where it is needed. This may be obvious and it’s not a “bug” per se but I’m sure it could confuse some users who are new to programming.

Side note:

LOVE THIS SITE!!! THANK YOU FOR ALL YOUR HARD WORK!!!

switch (num) {
  case value1:
    statement1;
    break;
  case value2:
    statement2;
    break;
...
  default:
    defaultStatement;
}

edit: challenge is still passable, is break unecessary? sorry for the confusion.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
raisedadeadcommented, May 31, 2017

Hi @krisb1220

freeCodeCamp ❤️ you too! And thanks for reporting the issue.

In this challenge’s pseudocode it does omits the “break;” statement where it is needed.

Both the case statements in the pseudo code have break statements. I am not sure what are you referring to.

Can you please clarify more?

1reaction
Greenheartcommented, Jul 19, 2017

I think we could add a break statement to the default case to make it clearer.

The fact that it’s possible to omit break statements in some cases (for the last case, for default or when using return in case blocks) is a detail that campers can learn in the future.

I’d say we can open this for first time contributors! 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pseudocode - TechnologyUK
Pseudocode is a compact and informal high-level description of a computer programming algorithm that uses the structural conventions of ...
Read more >
In a switch statement, what will happen if a break statement is ...
If a break statement was not placed at the end of a particular case portion? It will move on to the next case...
Read more >
Break and Continue statement in Java - GeeksforGeeks
Break : The break statement in java is used to terminate from the loop ... If omitted, execution will continue on into the...
Read more >
Pseudocode: A LATEX Style File for Displaying Algorithms
This paper describes a LATEX environment named pseudocode that can be used for describing algorithms in pseudocode form. This is the style used....
Read more >
while(true) and loop-breaking - anti-pattern?
It's more difficult to figure out how you'd exit the loop, and could invite bugs as the breaking condition might be bypassed or...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found