V
V
Vladimir Grabko2016-07-31 06:57:17
go
Vladimir Grabko, 2016-07-31 06:57:17

Why is goto evil?

I read a bunch of books and everywhere it says that GOTO is a branch of hell on earth. But I don't understand why he's being criticized so much. (don't throw stones! I don't use it)
Why not use goto instead of recursion?
Well, a very clear code comes out:

func () string {
small:
  id := generateString(32)
  if unique(id) {
    goto small
  }
  return id
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maaGames, 2016-07-31
@VGrabko

Because not evil, just a "beautiful" legend.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question