Comment

Comment by tome

I am entirely in agreement contingent upon there being some language construct which makes it possible to explicitly limit which variables from one block can be seen in subsequent blocks. For example

    DoAll() {
      // A
      a1 = ...
      a2 = ...
      a3 = ...

      withOnly a1, a3:
      // B
      b1 = f(a1)
      b2 = g(a3)
      
      withOnly b2:
      // C
      c1 = h(b2)
    }
Since this doesn't exist in any language, as far as I know, I guess I'll stick to using functions for now.
parent tome 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton