8 Matching Annotations
  1. Jul 2021
    1. and free of globals

      Ah! This remark highlights a fundamental difference in understanding between two camps, which I have been (painfully) aware of, but the source of this confusion has eluded me until only just right now. (Really, this is a source of frustration going back years.)

      In one camp, the advice "don't use global variables" is a way of attacking a bunch of things endemic to their use, most notably unnecessary coupling to spooky state. In another camp "no global variables" is taken literally, so you can have as much spookiness as you like, and so long as the value is not visible (accessible) from, say, another given piece of code appearing at the top-level ("global") context, as with the way i is bound to the activation record in this example but is not accessible outside the scope of getGetNext, then you're good.

      That is, there are two aspects to variables: scope and extent, and the first interpretation seeks to avoid the negative effects on both dimensions, while the second is satisfied by narrowly avoiding only those things effecting scope.

      I find the latter interpretation bizarre and completely at odds with the spirit of the exhortation for avoiding globals in the first place.

      (What's worse is the the second interpretation usually goes hand in hand with the practice of making extensive use of closures, which because they are propped up as being closely associated with functions, then leads people to regretfully refer to this style as functional programming. This is a grave error—and, to repeat, totally at odds with the spirit of the thing.)

  2. May 2021
  3. Oct 2020
  4. Jul 2017
    1. Cargo cultism is the bureaucratic rationality of blindly following established procedures and respecting authority. In the moral domain, that can lead ordinary people into committing genocide without reflection; in science, it leads to nutritional recommendations that may also have killed millions of people. When you look into how those recommendations were arrived at, it becomes obvious that honesty would compel the entire field of nutrition science to resign in recognition of its total failure—both scientific failure and moral failure.
    2. “Doing what scientists do” is not doing science, and won’t deliver—just as “doing what a ground crew does” doesn’t bring planes. It’s just going through the motions.
    3. In other words, you can only begin your career as a scientist by doing cargo-cult science. Eventually—if you are smart and lucky—you can upgrade. But almost all scientists get stuck at the cargo cult stage; and almost all supposed science is cargo culting.
    4. “Cargo cult” describes not just science, but much of what everyone does in sophisticated rich countries. I’m not speaking of our religions; I mean our jobs and governments and schools and medical systems, which frequently fail to deliver. Companies run on cargo cult business management; states run on cargo cult policies; schools run on cargo cult education theories (Feynman mentioned this one); mainstream modern medicine is mostly witch doctoring. An outsider could see that these cannot deliver, because they are scripted busy-work justified by ideologies that lack contact with reality. Often they imitate activities that did work once, for reasons that have been forgotten or were never understood.