Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
amethyst
on Aug 25, 2008
|
parent
|
context
|
favorite
| on:
A Java Syntax Quirk
What is the point of allowing labels in Java when goto is not available? Is there some other way of using/referencing labels that I am unaware of?
13ren
on Aug 25, 2008
|
next
[–]
break. One usecase: you have loops nested 3 deep, and you want to end it all when you find something. You label the outermost loop "exit", and then say "break exit;"
I think continue can use labels, too. (
EDITED
)
jamongkad
on Aug 26, 2008
|
parent
|
next
[–]
Forgive me but this is going to be a bit off topic. I think it's considered poor taste when a hacker decides to utilize nested loops 3 levels deep.
Tichy
on Aug 26, 2008
|
root
|
parent
|
next
[–]
Sometimes you might have no other choice? I think there are more important things to worry about than this.
ricky_clarkson
on Aug 26, 2008
|
root
|
parent
|
prev
|
next
[–]
I consider it poor taste when a hacker uses a loop (other than a tail call). Nesting is irrelevant.
gdee
on Aug 26, 2008
|
root
|
parent
|
next
[–]
oh... the height of silliness...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: