Tuesday, August 29, 2017

Media Diet, Spiritual Exercise

This is my hypothesis: that, just like our tastes for fats and sweets evolved under conditions of nutrient scarcity, and are probably harmful in an environment of abundance (hence, the obesity epidemic in America and elsewhere), so our social instincts evolved under conditions of life-long relationships with 150-or-so people are not well suited to a media environment driven by anonymously (or semi-anonymously) produced viral "content". I think this hypothesis accounts for a lot of our social ills, including social atomization, group polarization, and ego fragility, with the result that our social fabric is somewhere between frayed and shredded. Society is going off the rails because we, the people who make up society, by-and-large, have not adapted well to our new environment. I'll be straight, I don't like making sweeping statements as a rule, but I think these ills are just getting worse, and unless something is done to address the trends, I fear we're just going to come apart at the seams, in an ugly way. Avoiding that requires us to be better: more emotionally resilient, more willing to listen, more inclusive. We can do this, but, like keeping relatively physically healthy requires some combination of nutritional awareness, diet, and exercise, it will take work. Maintaining intellectual and, if I can say, spiritual health requires a similar program: In the same way that we have to understand our physiological biases to design an effective nutritional diet, we have to understand our emotional and cognitive biases, and the incentives of those who produce and deliver our media, to design an effective media diet; and in the same way that physical health is promoted by physical exercise, intellectual, emotional, and spiritual health also requires analogous forms of exercise: we need to seek out, process, and produce material that enriches us, and avoid that which panders to us.

First talking about media diet, we should appreciate that media content / distribution will have a lot to do with the incentives of its producers and distributors. To understand the biases present in the information we consume, we should understand the incentives of those involved in getting that information to us, as well as our own cognitive biases (which any motivated communicator may attempt to exploit). This is a deep subject, well worth exploring, and I might say more about it later. This post, though, is ultimately intended to help change behavior, so I'd rather talk about practice than theory for now.

Facebook, Twitter, Google, et al., determine what we see based on "relevance", or "engagement". The platforms that many of us rely on to keep us informed deliberately manage the information they present to us, based on what the platform believes we're looking for. This isn't nefarious, in fact it's broadly helpful. But it does end up leading to a feedback loop, where the things you respond to determine what you see. And when these things you're looking for are a matter of public debate, the usual result will be that you see things that won't cause you much discomfort, and you'll see what reinforces, rather than challenges, your preexisting beliefs. As this process repeats over time, we can invisibly become less tethered to an underlying reality, we can become more and more extreme. And when this process repeats in a social network, which we use (in part) to stay in touch with our social circle, our natural desire to be part of a community compounds this process still further.

The good news is that we can fight this process as individuals: we don't need Facebook to change its business model, we can adapt to it. Facebook optimizes your newsfeed for "engagement", so try to engage with more nuanced content. Avoid sharing or liking simplistic memes, share and like media that respects your intelligence, and that respects the intelligence of those who disagree with you, or that encourages sympathy for alternative points of view. Hopefully you will start seeing more such media, and you won't drift as easily from "consensus reality". Similarly, we don't need Google to change its business model, we can adapt to it. Google optimizes its search to be relevant to you, but you can - to an extent - ask Google not to do so for politically charged topics by browsing in "private" or "incognito" mode when you perform such searches. The results you get back should be less tailored to you, more representative of society. As far as Twitter goes... Well, it's designed to prevent nuance, so I kind of think that over-using twitter will probably make you a worse person. Sorry.

So the above is about media diet, but I also want to say something about intellectual / emotional / spiritual exercise. The following are principles that I, personally, use to try to preserve a sympathetic outlook in a coarsened media environment. I like to think that keeping these ideas and associated practices core helps me to keep my balance, keeps me from going off the rails.

  1. People are people. Sure, there is a lot of human variation, but there is a much larger volume of features we all share, and those common features will explain a much larger amount of our behavior. There are two specific implications of this tenet that inform much of my own ideology: First, that even those who do things we see as evil are motivated by feelings we'd recognize in ourselves (we can understand our enemies); Second, that feelings we recognize in ourselves can lead to evil (we must care for our souls).

  2. This is a paraphrase of some advice Bob Trivers' advisor gave him for some of his early research: "Never assume that the animal under study is as stupid as the one studying it." Anything widespread in nature probably exists for some reason, and if I don't know what that reason is, that's more likely due to ignorance or lack of imagination on my part, than it is that "people are crazy". Any hypothesis that fails the "people are people" test is almost certainly inadequate. Work harder to understand.

  3. We often don't know our own motivations. There are a lot of studies demonstrating that we are much more prone to rationalizing than we are to reasoning. Self-reported rationales for choices and behavior are valuable, but should be viewed with some skepticism.

  4. "I could be wrong." Of everything I've written, this might be the most important, but it's also a double-edged sword: people tend to trust the confident, but it's easy -- and often beneficial -- to have or to project confidence in things that are simply wrong. (Otherwise, there would be no con-men.) "Good" confidence, in my view, comes when an idea is challenged and remains standing. "Good" confidence tolerates and encourages doubt, understanding that surviving challenge increases credibility. I don't follow this perfectly, but in principle, I try to ask myself about all of my ideas, "What would the world look like if I am wrong?" I look for evidence to confirm or refute my hypotheses, or at least I try to remain open to such evidence. And if I find myself changing a hypothesis at every challenge, that could be a sign that the hypothesis is wrong, and I should think harder and listen better.

This is a lot of text, and if you've made it this far, thank you. I'm writing this because I'm afraid of how society seems to be changing (more of a concern with young kids); because it seems like this framing and this approach might help some of us to find ways to be more sympathetic and open; because if enough of us can communicate with each other again, then perhaps the social fabric won't end up completely undone; and because I haven't seen this point made elsewhere. If you disagree, please comment (after all, "I could be wrong"). If you agree, please help spread the word. I'm an imperfect messenger, I've got significant distrust of social media (if I trusted social media, I'd probably be full of righteous anger, but that's not conducive), but still, please like and share.

Wednesday, July 3, 2013

The Paradox of Architecture

The definition of software architecture I use most often is Chris Verhoen's, which can be paraphrased as "that which is expensive to change." Those aspects of the system that are most expensive to change are also the ones that we most want to get right. In fact, I would argue that a software architect's value to a project is manifest whenever she avoids an expensive wrong decision that would have been made in her absence. It then follows that the role of a software architect is to avoid expensive mistakes. (Note, though, that inaction will also generally be a mistake.)

You might notice that this is a negative characterization of an architect's role: an architect's role is defined by what she does not do (make expensive mistakes), rather than by what she does. I'll come back to this later, after making another observation about the above definition of "architecture".

Defining architecture as "that which is expensive to change" provides an operational basis for determining if an aspect of the system is architectural. That is, given an aspect of the system, you can ask "how expensive would it be to change this?" to determine if that aspect is architectural: if it's expensive to change, then it's architectural; if it isn't, then it's not.

And this brings us to the title of this little essay, something I'll call the Paradox of Architecture. To wit:

A large part of an architect's job is to avoid the introduction of architecture to a system.

I know this sounds completely backwards, and yet I believe it's true - the architect is responsible for preventing aspects of the design from becoming architectural. Consider the canonical example of a system designed without architecture, Foote and Yoder's Big Ball of Mud:

A BIG BALL OF MUD is haphazardly structured, sprawling, sloppy, duct-tape and bailing wire, spaghetti code jungle. We’ve all seen them. These systems show unmistakable signs of unregulated growth, and repeated, expedient repair. Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated. The overall structure of the system may never have been well defined. If it was, it may have eroded beyond recognition.

A defining characteristic of these systems is that they are extremely difficult to maintain. Every aspect of the system is difficult (read: "expensive") to change. As such, every aspect of the system is architectural. Nothing is a simple "implementation detail", because no detail can be examined in isolation from the whole system. The whole system must be understood for every change. A Big Ball of Mud is nothing but architecture, and it is un-maintainable for that very reason.

On the other hand, consider the traditional Unix architecture. Doug McIlroy summarized the underlying philosophy beautifully as:

Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.

(source: http://en.wikipedia.org/wiki/Unix_philosophy.)

Parts of the Unix architecture (like pipes, and untyped storage ("everything is a file")) are oriented around serving this philosophy. Nothing that did not server this philosophy was included, leaving Unix with a limited set of primitive operations. The expressive power of this limited set is what makes us consider Unix to be a well-architected system. The rest of a Unix system (which comprises its bulk) is much easier to change, because the architectural components are small and isolated. Most of Unix's value is not in its architecture, which is what makes its architecture so good.

Sunday, January 13, 2013

Aaron Swartz

I found myself pretty affected this weekend when I heard Aaron Swartz had hanged himself... I didn't realize it was the same person until just recently, but I'd encountered this series he put on his weblog (http://www.aaronsw.com/weblog/rawnerve) before, and a lot of it resonated with me (while a lot of it also read like things he was trying to convince himself of, rather than things he actually believed... but then, that was probably part of the point of his exercise)... Reading it again, it strikes me that it's not that surprising that he took his own life: the whole series is about embracing your weaknesses in as many domains as possible as part of a program of self-improvement... And though he must have succeeded at a lot of his self-improvement efforts (he inspired a lot of people, and he did some amazing things with his life), he didn't write about any successes in that series.

There's other back-story to his suicide, without which I believe he wouldn't have done it... (A U.S. prosecutor was apparently threatening him with 50 years of jail time for downloading (on a massive scale) scholarly articles from JSTOR.) I feel a strong connection to what he wrote about, though, and I feel like he only would have needed a few more years to find wisdom...

Wednesday, April 25, 2012

Pareto Distributions and Social Ills

You might have heard of the Pareto principle, more commonly known as the 80/20 rule. To paraphrase, the 80/20 rule describes systems where 20% of the inputs account for 80% of the outputs. For example:
  • 80% of the work is done by 20% of the people.
  • 80% of the wealth is owned by 20% of the population.
  • 80% of our food comes from 20% of our land.
If you apply the principle recursively (e.g. within those 20% of the people who do 80% of the work, 20% of those people are responsible for 80% of their higher level of output, and so on with any subdivision), you end up with a Pareto distribution with a parameter of log4(5). That is to say, the distribution is self-similar.

Wealth is usually agreed as being more-or-less Pareto distributed (in fact, it was the study of wealth distribution that lead Pareto to describe this distribution in the first place), though the parameter will be different depending on the level of inequality in the population under study. I think it's interesting to consider the interaction of this distribution with the sociological finding that individual happiness depends more on relative material well-being vs. one's neighbors than on absolute material well-being.

Let's start with the idea that the maximum size of a person's meaningful social network is approximately normally distributed across the population, and is not too dependent on the person's socio-economic-status. Strictly for illustration, we'll choose the mean maximum size of a person's social network as 100. Let's also assume that we tend to socialize with people with similar social status to our own. The question, then, is, under this system, how does the level of inequality that a person is exposed to vary with how much money he makes? And, further, how does his income affect his happiness?

Lorenz curves
Observing the slopes of these Lorenz curves, it's clear that a person nearer the right of the distribution (in our scenario, a member of the rich) will be exposed to much greater inequality than one further away. He is more likely to know people who have (what he'll consider) unjustifiably more income than himself, which will tend to hurt his happiness. Further, as inequality increases, there will be fewer "rich" who are exposed to more inequality within their own social circle, and who will be less happy with their lot as a result. An interesting corollary is that, in a less equal society, people on the poorer end would be exposed to less inequality within their social network - the perception of inequality is also distributed unequally.

There are a few outcomes that I think result from this dynamic. Speaking in broad generalizations, and ignoring the behavior of specific individuals, I think there will be a tendency for:
  • The rich to become ever more individually motivated, as the increase in income from a moderate improvement in position grows exponentially as you become richer.
  • A rich person's sense of well-being to be reduced. We try to live within our means, but in an unequal society, the rich will experience much greater volatility in their means than the rest of us do, making it harder to determine what the means are that they are trying to live within. This is stressful.
  • The poor to lose motivation, as moderate improvement in relative position will not lead to a proportionate increase in income.

Some of this discussion conflates within-lifetime inequality to across-society inequality. I will try to address that, later.

Saturday, July 30, 2011

Intellectually Tractable Code

The task of writing software consists in large part of minimizing the intellectual burden necessary to completely understand a problem and its solution. In fact, I would argue that our intuition about how "clean" a piece of software is is, in essence, a measure of how closely our understanding of a solution matches the "essential" complexity of an ideal solution. A "clean" module will have a low intellectual burden for complete understanding.

As an example, consider two alternative library implementations of a singly-linked-list data structure:
  • In implementation A, list operations include semaphore locks, to ensure that the list is always in the appropriate state.
  • In implementation B, there are no locks - it is assumed that the caller will always take care to ensure that list manipulation / use is appropriately protected for concurrent access.

It is my contention that implementation B is cleaner, for two major reasons:
  1. There is no one design decision for the locking semantics that will be universally applicable. For example, there may be state-variable relationships to be maintained that cross the locking boundary for that entry on the list (like "links 1 and 2 must be added and removed from two different lists at the same time"); the type of locking is set in stone at compile-time, though it may be better to be different for different scenarios (e.g. lock using semaphores for this list; lock using critical sections for this other list; no locks necessary at all for this third list). This means that the developer must _still_ reason about locking in order to use this module effectively - only now it isn't as obvious that she needs to do so, or (to another developer) it isn't as obvious if she _has_ reasoned about locking to protect the relationships between her state variables. Run-time use is less intellectually tractable.

  2. It adds unnecessary dependencies for the linked-list module to work. Linked-list maintenance is well-suited to use in a single-threaded environment, but embedding locks within the linked-list maintenance code prevents deploying the module to environments that lack appropriate locking primitives. Unnecessary dependencies can also lead to layering problems - as when the linked-list maintenance depends upon the scheduler's locking primitives, what happens if the scheduler depends upon the linked-list module? What happens if the scheduler depends upon the linked-list module during initialization, prior to the locking primitives becoming available for use? Instantiation is less intellectually tractable.

There exist general guidelines for making code intellectually tractable, which I will try to expand upon in later posts.

Tuesday, October 5, 2010

Mastery Against Generality (or, "Keep It Concrete, Stupid")

LtU pointed me to Design Principles Behind Smalltalk. I'll quote the first design principle named, because it illustrates what I think is a mistake in reasoning common to those of a mathematical bent:
Personal Mastery: If a system is to serve the creative spirit, it must be entirely comprehensible to a single individual.

The point here is that the human potential manifests itself in individuals. To realize this potential, we must provide a medium that can be mastered by a single individual. Any barrier that exists between the user and some part of the system will eventually be a barrier to creative expression. Any part of the system that cannot be changed or that is not sufficiently general is a likely source of impediment. If one part of the system works differently from all the rest, that part will require additional effort to control. Such an added burden may detract from the final result and will inhibit future endeavors in that area. We can thus infer a general principle of design:
Good Design: A system should be built with a minimum set of unchangeable parts; those parts should be as general as possible; and all parts of the system should be held in a uniform framework.

I strongly sympathize with the point of view outlined here. If one can master simple, general principles, then that reduces the burden for understanding some set of more specific ideas, and can potentially greatly increase the number and scope of the ideas one can understand and use at any given time -- it can improve one's intellect.

That said, it is considerably more difficult to impart understanding of general ideas than of specific ones. If this isn't immediately obvious to you, consider the order in which you learned some mathematical concepts. Take the following problems:
  1. If joey has three apples, and gives two away, how many does he now have?
  2. Solve for x: x = 3 - 2.
  3. Prove that the addition operation under the set of integers modulo some constant forms a group.
  4. Give an example of a non-Abelian group.
  5. What the hell is a left-adjoint functor?

I think you can be expected to gain mastery of each of these problems in the same order in which the problems are listed. Each problem is more abstract than the previous, and each successive problem is, in a sense, simpler and more general than the previous. But each successive problem is also, to my mind, more difficult than the previous: We needed to understand the more specific ideas before we could be expected to generalize. The mechanism for "good design" quoted above can probably be considered to be in some tension with the stated goal of maximizing "personal mastery" of the system.

The implications of this tension are, I think, important. In particular, under the assumption that a more abstract understanding of a problem domain can make the problem more tractable, it's usually in any given author's interest to move "up" the "abstraction ladder", in order to better solve a problem herself. To the extent that this means she happens upon a good solution faster than others, this is all to the good. But to the extent that this means she happens upon much different solutions than others would, then however much more "elegant" her own solution is will be weighed against the cost in comprehension for others she works with.

Thursday, June 10, 2010

What's Missing

I believe, but will not attempt to demonstrate here, that the widely used applications on the Internet are great for people looking to encounter information about subjects that they already know they are interested in. Google will generally find us the Wikipedia article for just about any search. This formulation hints at what I think is a big shortcoming in these tools: getting information to a decent depth on any topic is much easier than determining the breadth of topics in which we would want to be interested.

I mean:

  • Pandora Radio will be able to tell you that, if you like Beirut, you will probably like Andrew Bird and Devotchka. If you like Andrew Bird, it will tell you that you'd probably like Beirut and Devotchka, and if you like Devotchka it will tell you that you'd probably like Beirut and Andrew Bird. But you won't easily find out, starting from any of these bands, if you like Faye Wong. How can we find out?
  • There was a lot of discussion on a number of political blogs recently about Epistemic Closure, a term used in this context to describe a conversation that occurs only between individuals who already agree on the topic discussed, and that has the effect of cementing the participants' opinions. This is certainly facilitated by the Internet.
  • It's been argued that America is self-segregating into demographically and ideologically similar clusters (i.e. geographically constrained units in which within-region variation is much lower than between-region variation).


A theme of this blog is the danger associated with too much social learning (too much "received wisdom"), and too little individual learning (including techniques like deriving results from first principles, or from experimentation). Obviously some balance needs to be maintained, and I believe this balance will be different for different subjects, and for different people. One thing I have tried (and am trying) to contribute is a discussion about what this balance should be, under what circumstances. A mathematician probably believes that she needs to understand all the ideas she uses for her own work thoroughly. In my first undergraduate statistics courses, we were taught how to use particular statistical methods, but were taught almost nothing about how or why they work. The mathematician favored individual learning, the statistician (at least at that low level) favored social learning.

In this post, though, I'd like to pose the question: what is the best way to leverage the breadth of communities on the Internet, so that we can discover things in domains in which we haven't shown much interest before? How can we easily discover things that will challenge our beliefs, instead of reinforcing them? If our beliefs are never really challenged, we'll never really know who we are as individuals... Some things are happening in this area already. I have some ideas of my own. I'll try to expand on this later.