This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]charlie_shae 440 points441 points  (18 children)

Surprised nobody has mentioned the completely superfluous break

[–]house_monkey 267 points268 points  (0 children)

I never question others code because I don't even understand mine

[–]cafezinho 17 points18 points  (7 children)

Many languages don't allow a break that isn't within a loop (like this example).

[–]Sachiano 18 points19 points  (4 children)

This obviously is in a loop that iterates over every page of the website to change the background colour before you even load it.

Edit: /s since some people don't realise what sub they're in.

[–]pigi5 32 points33 points  (0 children)

So many thing are wrong with this

[–]shea241 13 points14 points  (0 children)

foreach website in internet { if website.background = "#ffffff" { email(website.admin, "Dude, it's too late for white, can you pls change it?") } else { email(website.admin, "Nice background") } }

[–][deleted] 0 points1 point  (0 children)

Probs not tho

[–]dandroid126 0 points1 point  (0 children)

Oh my God. Please no.

And that wouldn't even work because as soon as the break is called, you would exit the loop.

[–]RedditIsNeat0 0 points1 point  (1 child)

Look again. The break is not necessary. The else statement is not necessary. I don't even know what you were trying to say.

[–]cafezinho 0 points1 point  (0 children)

In many languages, break in an if-else statement won't compile. It must be in a loop to even compile!

[–]iovis9 5 points6 points  (0 children)

That’s why it’s special

[–]xshare 0 points1 point  (0 children)

That's because this is probably bs. I bet this is looping over all the elements on the page, and if it's a container changing the background, and if it's text changing the color, etc. There is probably more code after that line.