Hacker News new | ask | show | jobs
by Beltalowda 1265 days ago
I sometimes do something like:

  var foo string
  { // Do stuff
      // ...
      foo = "..."
  }

  { // Other section...
  }
You can also split stuff up in to sections, but for some kind of functions where you know the functions will never be re-used and are intimately related, I find this clearer.

Of course, your language will need to have block scope, or at least blocks.