30 ms·
I sometimes do something like: var foo string { // Do stuff // ... foo = "..." } { // Other section... } You can also split stuff up in
by Beltalowda 4y 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.