3 ms·
Copy and pasting blocks? That's a red flag right there, remember that next time you're doing it, and think how you could do it without the copy and pasting
by mrbig4545 11y ago
Copy and pasting blocks? That's a red flag right there, remember that next time you're doing it, and think how you could do it without the copy and pasting
- MichaelGG 11y agoHow would you do it in many of those cases? For instance: ax[i] = bx[i] ay[i] = by[i] az[i] = bz[i] Can the languages used write this in a better way? I do agree that having inner functions and making them easy to define is better, but it's not always possible. In F# I could write: let assign i (a,b) = a[i] <- b[i] [ax,bx; ay,by; az,bz] |> Seq.iter (assign i) But that's allocating a list (and if I closed over i, it'd allocate a closure too). Really good macro support would fix this, though. And it's only marginally better in this case. (For more elaborate cases it might be easier to scan.)