10 interesting stories served every morning and every evening.
What ORMs have taught me: just learn SQL
I’ve come to the conclusion that, for me, ORMs are more detriment than beneﬁt. In short, they can be used to nicely augment working with SQL in a program, but they should not replace it.
Some background: For the past 30 months I’ve been working with code that has to interface with Postgres and to some extent, SQLite. Most of that has been with SQLAlchemy (which I quite like) and Hibernate
(which I don’t). I’ve worked with existing code and data models, as well as designing my own. Most of the data is event-based storage (“timelines”) with a heavy emphasis on creating reports.
Much has been written about the Object/Relational Impedance Mismatch. It’s hard to appreciate it until you live it. Neward, in his
well known essay, lays out many cogent reasons why ORMs turn into quagmires. In my experience, I’ve had to deal directly with a fair number of them: entity identity issues, dual-schema problem, data
retrieval mechanism concern, and the partial-object problem. I want to talk brieﬂy about my experiences with these issues and add one of my own.
Perhaps the most subversive issue I’ve had with ORMs is “attribute creep” or “wide tables”, that is, tables that just keep accruing attributes. As much as I’d like to avoid it, sometimes it becomes necessary (although things like Postgres’ hstore can help). For example, a client may be providing you with lots of data that they want attached to reports based on various business logic. Furthermore, you don’t have much insight into this data; you’re just schlepping it around.
This in and of itself isn’t a terrible thing in a database. It becomes a real pain point with an ORM. Speciﬁcally, the problem starts to show up in any query that uses the entity directly to create the query. You may have a Hibernate query like so early on in the project.
This may be ﬁne when Foo has ﬁve attributes, but becomes a data ﬁre hose when it has a hundred. This is the equivalent of using SELECT *, which is usually saying more than what is intended. ORMs, however, encourage this use and often make writing precise projections as tedious as they are in SQL. (I have optimized such queries by adding the appropriate projection and reduced the run time from minutes to seconds; all the time was spent translating the database row into a Java object.)
Which leads to another bad experience: the pernicious use of foreign keys. In the ORMs I’ve used, links between classes are represented in the data model as foreign keys which, if not conﬁgured carefully, result in a large number of joins when retrieving the object. (A recent count of one such table in my work resulted in over 600 attributes and 14 joins to access a single object, using the preferred query methodology.)
Attribute creep and excessive use of foreign keys shows me is that in order to use ORMs effectively, you still need to know SQL. My contention with ORMs is that, if you need to know SQL, just use SQL since it prevents the need to know how non-SQL gets translated to SQL.
Knowing how to write SQL becomes even more important when you attempt to actually write queries using an ORM. This is especially important when efﬁciency is a concern.
From what I’ve seen, unless you have a really simple data model (that is, you never do joins), you will be bending over backwards to ﬁgure out how to get an ORM to generate SQL that runs efﬁciently. Most of the time, it’s more obfuscated than actual SQL.
And if you elect to keep the query simple, you end up doing a lot of work in the code that could be done in the database faster. Window
functions are relatively advanced SQL that is painful to write with ORMs. Not writing them into the query likely means you will be transferring a lot of extra data from the database to your application.
In these cases, I’ve elected to write queries using a templating system and describe the tables using the ORM. I get the convenience of an application level description of the table with direct use of SQL. It’s a lot less trouble than anything else I’ve used so far.
This one seems to be one of those unavoidable redundancies. If you try to get rid of it, you only make more problems or add excessive complexity.
The problem is that you end up having a data definition in two places: the database and your application. If you keep the definition entirely in the application, you end up having to write the SQL Data Deﬁnition Language (DDL) with the ORM code, which is the same complication as writing advanced queries in the ORM. If you keep it in the database, you will probably want a representation in the application for convenience and to prevent too much “string typing”.
I much prefer to keep the data definition in the database and read it into the application. It doesn’t solve the problem, but it makes it more manageable. I’ve found that reﬂection techniques to get the data definition are not worth it and I succumb to managing the redundancy of data deﬁnitons in two places.
But the damn migration issue is a real kick in the teeth: changing the model is no big deal in the application, but a real pain in the database. After all, databases are persistent whereas application data is not. ORMs simply get in the way here because they don’t help manage data migration at all. I work on the principle that the database’s data definitions aren’t things you should manipulate in the application. Instead, manipulate the results of queries. That is, the queries are your API to the database. So instead of thinking about objects, I think about functions with return types.
Thus, one is forced to ask, should you use an ORM for anything but convenience in making queries?
Dealing with entity identities is one of those things that you have to keep in mind at all times when working with ORMs, forcing you to write for two systems while only have the expressivity of one.
When you have foreign keys, you refer to related identities with an identiﬁer. In your application, “identiﬁer” takes on various meanings, but usually it’s the memory location (a pointer). In the database, it’s the state of the object itself. These two things don’t really get along because you can really only use database identiﬁers in the database (the ultimate destination of the data you’re working with).
What this results in is having to manipulate the ORM to get a database identiﬁer by manually ﬂushing the cache or doing a partial commit to get the actual database identiﬁer.
I can’t even call this a leaky abstraction because the work “leak” implies small amounts of the contents escaping relative to the source.
Something that Neward alludes to is the need for developers to handle transactions. Transactions are dynamically scoped, which is a powerful but mostly neglected concept in programming languages due to the confusion they cause if overused. This leads to a lot of boilerplate code with exception handlers and a careful consideration of where transaction boundaries should occur. It also makes you pass session objects around to any function/method that might have to communicate with the database.
The concept of a transaction translates poorly to applications due to their reliance on context based on time. As mentioned, dynamic scoping is one way to use this in a program, but it is at odds with lexical scoping, the dominant paradigm. Thus, you must take great care to know about the “when” of a transaction when writing code that works with databases and can make modularity tricky (“Here’s a useful function that will only work in certain contexts”).
Where do I see myself going?
At this point, I’m starting to question the wisdom behind the outright rejection of stored procedures. It sounds heretical, but it may work for my use cases. (And hey, with the advent of “devops”, the divide between the developer and the database administrator is basically non-existent.)
I’ve found myself thinking about the database as just another data type that has an API: the queries. The queries return values of some type, which are represented as some object in the program. By moving away from thinking of the objects in my application as something to be stored in a database (the raison d’être for ORMs) and instead thinking of the database as a (large and complex) data type, I’ve found working with a database from an application to be much simpler. And wondering why I didn’t see it earlier.
Regardless of whether I ﬁnd that stored procedures aren’t actually that evil or whether I keep using templated SQL, I do know one thing: I won’t fall into the “ORMs make it easy” trap. They are an acceptable way to represent a data definition, but a poor way to write queries and a bad way to store object state. If you’re using an RDBMS, bite the bullet and learn SQL.
Send comments to wozniak.ca with the local part being comment
What you’ll ﬁnd on Do It Yurtself! Thanks for checking it out. Go build a yurt!
Videos by: - Jason Rayne - Octave Zangs
Photos by: - Bryan Aulick - Jory Block
Progress against big problems — the focus of our work at Our World in Data — is possible because of new ideas: humanity started to win the war against infectious diseases when scientists started to understand that it is microscopic pathogens that infect and kill us. The germ theory of disease was just the ﬁrst step; based on this insight others followed with more ideas — a myriad of new technologies, but also public health interventions. It was only once we understood the origins of infectious diseases that we realized the importance of now seemingly obvious ideas, such as supplying households with clean water.1
The same is true for progress against other problems: the ideas that sparked technological innovation made societies richer, and breakthroughs in the development of agricultural technology made it possible that while the world population increased rapidly hunger decreased at the same time.
The list of innovations we need is long: clean and cheap energy, better crops, interventions to help against the diseases that shorten and impair our lives. This, and much more besides, is needed to make progress against the big problems we face. But while the demand for innovation is large, its supply is limited.
Those who have brilliant ideas are often able to make a good living from them for themselves. But beyond their private returns big insights and discoveries beneﬁt society as a whole. The very best ideas — think about penicillin, synthetic fertilizers, or vaccines — beneﬁt every person on the planet.
For both reasons — personal opportunity and social beneﬁt — we should make sure that all talented people have the chance to develop new ideas. But this is not the case.
’Who becomes an inventor in America?’ — is the title of a study by Alex Bell, Raj Chetty, Xavier Jaravel, Neviana Petkova, and John Van Reenen published in 2019.2
It is based on an impressively comprehensive dataset. The authors studied the lives of 1.2 million inventors in the US from birth to adulthood.3
The authors wanted to answer the question: what is it that matters for whether a child grows up to become an inventor? They studied two aspects: personal ability at a young age and the circumstances in which a child grows up.
To study ability they matched a subset of their data on inventors with records of their math scores back when they were third graders.4 To study the role that circumstances play the research team matched the inventor dataset with tax record data that allowed them to study the socio-economic situation they grew up in.
Skills matter a lot. Those who were good at maths at a young age were much more likely to become inventors later in life.
The ﬁndings on how much circumstances matter are just as clear. Whether children grew up to become inventors later in life depends on the environment they grew up in.
The circumstances that matter are to a large extent economic: Those who grew up in richer families were much more likely to become inventors later in life. These differences are big. The study illustrates this by comparing students from poor and high-income families. The income threshold is high: the authors chose a cutoff that separates the bottom 80% of American families from the rest. Of the highest scoring 5% of students, those from high-income families were more than twice as likely to become inventors as those at lower incomes.
The study further shows that very speciﬁc circumstances play an additional big role: Thanks to the very large dataset that includes information from very different regions within the country, the researchers show that it is exposure to innovators during childhood that matters. Children who grew up in an area, or better yet a family, with many inventors were more likely to follow their path and become innovators themselves. Children look for role models, and when they are exposed to science and innovation some end up following in their idol’s footsteps.
Skills and circumstances matter. What is tragic is when children have the ability, but were denied the circumstances that would have helped them to fulﬁll their potential. The authors coined the term ‘Lost Einsteins’ for these children.
The researchers also studied why is it that far fewer girls than boys grew up to become inventors. Differences in skills at a young age are not the explanation: test scores of boys and girls were very similar according to the study.5 Instead the researchers ﬁnd that talented girls were much less likely to become innovators than equally talented boys and show that it is the exposure to role models that can explain these gender differences. Those girls who are exposed to women who are inventors are more likely to grow up to be inventors themselves. The lack of role models in the older generation brings about a lack of role models in the younger generation. The gender gap in innovators is still large. Only 18% of US inventors born in 1980 are women. To extend the authors’ metaphor: even more common than ‘Lost Einsteins’ are ‘Lost Marie Curies’.
The disadvantage of some children comes at a cost to all of us. Overall, the researchers estimate that if high-ability children from disadvantaged groups would beneﬁt from the same circumstances as the best-off groups, there would be four times as many inventors in the US as there are today.
And we are not just losing inventors: we all losing out on teachers, artists, writers, political leaders, scientists, painters, thinkers, musicians and the many other ways in which talented young people can enrich the world of all of us when they ﬁnd themselves in a supporting environment.
The study on inventors does not only shed light on the loss of inventors in our world today, but also help to understand the history of innovation. The world surely saw many exceptionally talented people in our long history, but for millennia they grew up in poverty, hunger, poor health, and with little access to education. Very few bright children in our long history lived in circumstances that made it possible for them to fulﬁll their potential. Lost Marie Curies and Einsteins are not rare; there were many thousands of them throughout humanity’s history.
At various times some were lucky enough to enjoy better living conditions and develop ideas that altered their society’s circumstances and culture. Some of history’s many exceptional people were fortunate to be born in the past civilizations of ancient Greece, China, Rome, or the Indus-valley and were able to develop artistic, scientiﬁc, or technological innovations that had a lasting legacy. But for the vast majority, the daily struggle in the extremely poor pre-growth economies was hard. Personal development was not easy in times when most people were required to work in agriculture to produce enough food, many were sick and undernourished, many lived as slaves, and even very basic educational skills — like reading and writing — were a privilege of the very rich.
But two centuries ago the trickle of innovators became a stream when, for the ﬁrst time in history, living conditions started to improve for large parts of the population in entire world regions. The Industrial Revolution ﬁrst changed Northwestern Europe where health improved, and incomes increased. North America and Oceania followed soon after. At the start of the 20th century life expectancy in these regions had increased to 45 to 55 years, while the rest of the world remained with a life expectancy between 23 and 30. Only in the better-off regions did the average adult have some formal education.
It was this improvement in living conditions for the masses that was key to enable further economic growth and improvements in living conditions. It started a virtuous circle between ideas leading to better living conditions and better living conditions enabling better ideas. The scientiﬁc revolution powered the industrial revolution and industrialization in turn raised living conditions and enabled more people to contribute to science and innovation.
The global inequality in living conditions that emerged is reﬂected in the big innovations of the time. Penicillin, synthetic fertilizers, and vaccines were largely developed in those places where children grew up in the best conditions. The huge majority of Nobel Prize winners in the ﬁrst half of the 20th century came from the richest regions on the planet — Europe and North America.6
Just as it is very hard for a child from a disadvantaged background in the US to become an inventor, the same was true for billions of children who grew up in poor living conditions throughout history. Children with great potential ended up living a life in poverty, working as farmers and struggling to feed their families and themselves.
Being a great artist, scientist or inventor is of course not the only way to live a fulﬁlled life and contribute to society, but it is tragic when children who had the ability were prevented from reaching their potential. Tragic for themselves, but also for all of us who missed out on their work that could have enriched our lives, given us a better understanding of our world, and gotten us closer to solutions of problems that we all share.
Life is about much more than solutions to problems and we are not only missing out on innovations, but also art, writing, research, music — the entire breath of human creativity that ﬂourishes when talent and dedication come together with enabling circumstances. Our losses are unimaginable.
Maybe it is difﬁcult to imagine what the life of a talented child could have looked like if he or she had not been born in a poor English village in the Middle Ages. But the same is true for different places in our world today. In this context it might be easier to imagine how living conditions matter.
What would have been the chances for Steve Jobs if he was born in the Central African Republic? And what would have been possible for Taylor Swift if she grew up in Papua New Guinea instead of Pennsylvania and Nashville? And the other way around: What could the world’s poorest children grow up to be if they had the circumstances of Steve Jobs or Taylor Swift?
What would our world look like if all talented children had a good chance to become innovators and artists instead of growing up hungry, in poor health, and with poor education?
Surely we all are missing out on many of the most talented people in the world. The US study showed that not belonging to the richest 20% of American families gives children a much worse chance at being an innovator. Income inequality in the world is so large that Americans who are poorer than 90% of other Americans are richer than more than 70% of the world population.7
It is not just in terms of economic circumstances that the majority of children ﬁnd themselves worse off than children in America. Children at school-entry age can expect 16.5 years of education in the US, but only 5 years on average in poor countries. And estimates from the latest global data show that 60 million children of primary-school age do not attend school at all, and those who go to school in poor countries also learn much less. For a child growing up in a poor place it is extremely hard to obtain the level of education an average person gets in the best-off places.
And the cited research suggests that it is not just income and access to education that matter. If the role model effect that the US study emphasized exists everywhere, then poor living conditions are compounded by the fact that most children in most places are exposed to very few role models in research and innovation.
The map below shows the global distribution of research and development, here given as the share of people employed in research and development. The hotspots are six countries in which more than 6000 per million inhabitants work in research and development: South Korea, Singapore, Israel and three Scandinavian countries (Sweden, Finland, and Denmark). 6000 per million means that 1 out of 1667 people works in R&D. Even in the best-off countries, very few focus on innovation.
As the historical discussion above would suggest there is a strong correlation between economic development and research and development. In some poor countries less than 30 per million are engaged in R&D.
What is true in the US, and what has been true throughout history, is true for the world today: science, research, and development can ﬂourish where large parts of the population are relatively well off.
If all countries in the world had the same concentration of researchers as rich countries, there would be around three-times as many researchers in the world; if the entire world had the concentration of the top six countries there would be more than ﬁve-times higher.8
The circumstances for those researchers differ widely too. Spending on R&D differs between 4.25% of GDP in Israel and South Korea to below 0.1% in many poor countries.
Finding solutions to big problems has always been hard. And there is evidence that suggests that it is getting harder: Michael Nielsen and Patrick Collison (here) and also Scott Alexander recently argued that while the world is certainly dedicating much larger resources — both people and funding — to science, research and development, the rate of progress in physics, medicine, and other important ﬁelds kept at best constant over the last century.9
The world’s most limited resource is not oil, iron, or coal, but the potential of the human mind.
We lack treatments for a large range of diseases; we need to decarbonize the global economy; we should transform our food system to one that feeds the world while reducing its impact on the environment that we rely on; if anyone has the ideas to solve these problems, everyone can beneﬁt from them at the same time. Someone living in Europe or America beneﬁts if someone in India or Africa becomes better off and invents that medical drug, the technology to produce cleaner energy, or those new crops.
The demand for new ideas from which we would all beneﬁt is enormous, but because opportunities are limited, the supply of new ideas is limited.
Talent and ability are everywhere, but opportunity is not.
There are 2 billion children under the age of 15. Focussing our efforts on improving the conditions in which the young generation grows up is a big challenge, but also a fantastic opportunity. All who are in power today will be gone soon and the generation who is growing up now will take the lead. All will go through the education system we offer them today; whether they can realize their potential depends on the circumstances in health, shelter, food, prosperity, freedom, and education that we can provide for them.
Improving living conditions is our moral duty, but beyond that it is also the way to increase the supply of much needed creativity and innovation. This means that there is a selfish reason for all of us to do what we can to support global development. Better education and improving circumstances in which children grow up can allow them to reach their potential. Historically we have seen how improving circumstances can lead to innovation which feeds back to improving living conditions. These positive feedback loops have changed many places around the world and are needed to solve the big problems that we all face. This is why it is so very important to continue the positive developments of the last decades with more children surviving, more children growing up free of the worst poverty, and more children being better educated than ever before. If I am optimistic about the future of the world and progress against the world’s problems it is because of this.
What you can do — and also: this article as a Kurz Gesagt video:
As I argued in the article, I believe that the main reason why we should be interested in improving global living conditions is a moral one: we need to do what is possible to allow everyone to live a life free of poverty, free of hunger, and free of premature death.
– Givewell.org studies where your donation can make the biggest difference against the world’s large problems.
– 80000hours.org helps you choose a career in which you can have the biggest positive impact to make progress against the world’s largest problems.
But in addition to the moral argument, there is also a selfish argument: because we all beneﬁt from everyone else’s ideas, we should all have an interest in enabling everyone to live a good life. Last year I worked with the great Kurz Gesagt team on this video that is based on the ideas of this article.
Everyone always talks about how much money there is in politics. This is the wrong framing. The right framing is Ansolabehere et al’s: why is there so little money in politics? But Ansolabehere focuses on elections, and the mystery is wider than that.
Sure, during the 2018 election, candidates, parties, PACs, and outsiders combined spent about $5 billion — $2.5 billion on Democrats, $2 billion on Republicans, and $0.5 billion on third parties. And although that sounds like a lot of money to you or me, on the national scale, it’s puny. The US almond industry earns $12 billion per year. Americans spent about 2.5x as much on almonds as on candidates last year.
But also, what about lobbying? Open Secrets reports $3.5 billion in lobbying spending in 2018. Again, sounds like a lot. But when we add $3.5 billion in lobbying to the $5 billion in election spending, we only get $8.5 billion — still less than almonds.
What about think tanks? Based on numbers discussed in this post, I estimate that the budget for all US think tanks, liberal and conservative combined, is probably around $500 million per year. Again, an amount of money that I wish I had. But add it to the total, and we’re only at $9 billion. Still less than almonds!
What about political activist organizations? The National Riﬂe Association, the two-ton gorilla of advocacy groups, has a yearly budget of $400 million. The ACLU is a little smaller, at $234 million. AIPAC is $80 million. The NAACP is $24 million. None of them are anywhere close to the ﬁrst-person shooter video game “Overwatch”, which made $1 billion last year. And when we add them all to the total, we’re still less than almonds.
Add up all US spending on candidates, PACs, lobbying, think tanks, and advocacy organizations — liberal and conservative combined — and we’re still $2 billion short of what we spend on almonds each year. In fact, we’re still less than Elon Musk’s personal fortune; Musk could personally fund the entire US political ecosystem on both sides for a whole two-year election cycle.
But let’s go further.
According to this article, Mic.com sold for less than $5 million. Mashable sold for less than $50 million. The whole Gawker network (plus some other stuff including the Onion) sold for $50 million. There are some hints that Vox is worth a high-eight-digit to low-nine-digit amount of money. The Washington Post was sold for $250 million in 2013 (though it’s probably worth more now). These properties seem to be priced entirely as cash cows — based on their ability to make money through subscriptions or ads. The extra value of using them for political inﬂuence seems to be priced around zero, and this price seems to be correct based on how little money is spent on political causes.
Or: Jacobin spends a lot of time advocating socialism. The Economist spends a lot of time advocating liberalism. First Things spends a lot of time advocating conservatism. They all have one thing in common: paywalls. How could this be efﬁcient? There are millions of people who follow all of these philosophies and really want to spread them. And there are other people who have dedicated their lives to producing great stories and essays advocating and explaining these philosophies — but people have to pay $29.99 for a subscription to read their work? Why do ideologies make people pay to read their propaganda?
Maybe the most extreme example here is Tumblr.com, which recently sold for $3 million, ie the cost of a medium-sized house in San Francisco. Tumblr has 400 million monthly visitors, and at least tens of millions of active users. These people talk politics all the time, usually of a far-left variety. Nobody thinks that one of the central political discussion platforms of the far-left is worth more than $3 million? Nobody on the right wants to shut it down? Nobody on the left wants to prevent that from happening? Nobody with a weird idiosyncratic agenda thinks being able to promote, censor, or advertise different topics on a site with tens of millions of politically engaged people is at all interesting?
The low level of money in politics should be really surprising for three reasons.
First, we should expect ordinary people to donate more to politics. A lot of the ordinary people I know care a lot about politics. In many of the events they care about most, like the presidential primaries, small donations matter a lot — just witness Tom Steyer begging for small donations despite being a billionaire. If every American donated $25 to some candidate they supported, election spending would surpass the almond industry. But this isn’t even close to happening. Bernie Sanders is rightly famous for getting unusually many small donations from ordinary people. It’s not clear exactly how much he’s received, but it looks like about $50 million total. This sounds like a lot of money, but if you use polls to estimate how many supporters he has, it looks like each supporter has on average given him $2. This is a nice token gesture, but surely less than these people’s yearly almond budget.
Second, we should expect the rich to donate more to politics. Many politicians want to tax billionaires; billionaires presumably want to prevent that from happening. Or wealthy people might just have honestly-held political opinions of their own. As rich as Elon Musk is, he’s only one of ﬁve hundred billionaires, and some of the others are even richer. So how come the amount of money in politics is so much less than many individual billionaires’ personal fortunes?
Third, we should expect big corporations to donate more to politics. Post Citizens United, corporations can supposedly put as much money into politics as they want. And they should want a lot. The government regulates corporations, so having friendly politicians in power can mean life or death for entire industries. Suppose hostile government regulation could decrease Exxon Mobil’s revenues 5% — you would think Exxon Mobil would be willing to spend 4% of its revenue to prevent this. But Exxon makes $280 billion per year. 4% of its revenue would already be larger than the whole US political ecosystem! In fact, according to Exxon’s own records, they only spend about $1 million per cycle. While they’re probably hiding something, they couldn’t hide donations the size of the whole rest of the political ecosystem, so it’s still pretty mysterious.
I think there are individual factors affecting all of these. As mentioned before, elections have spending limits (however inconsistently enforced) and may not be tractable to money. Think tanks may be more talent-limited than funding-limited. Media properties may be limited by the opinions of their journalists and subscribers (the Washington Post couldn’t pivot to being a conservative outlet without getting completely different employees and customers). Tumblr has already proven unable to censor its users without sparking a mass exodus. These issues are probably responsible for part of the underpricing. But it still seems surprising.
In his paper on elections, Ansolabehere focuses on the corporate perspective. He argues that money neither makes a candidate much more likely to win, nor buys much inﬂuence with a candidate who does win. Corporations know this, which is why they don’t bother spending more. Most research (plus the 2016 results) conﬁrms that money has little effect on victory, so maybe this is true. But it would also have to be true that lobbying, the NRA, the media, etc don’t affect politics very much, which seems like a harder sell.
That leaves the Bernie Sanders supporters. Even if money doesn’t affect politics, Sanders supporters seem like about the least likely people to believe that. I think here we have to go back to the same explanation I give in Does Class Warfare Have A Free Rider Problem? People just can’t coordinate. If everyone who cared about homelessness donated $100 to the problem, homelessness would be solved. Nobody does this, because they know that nobody else is going to do it, and their $100 is just going to feel like a tiny drop in the ocean that doesn’t change anything. People know that a single person can’t make a difference, so they don’t want to spend any money, so no money gets spent. This is true for ordinary people, but it’s also true for billionaires and greedy corporations. No single greedy corporation wants to pony up the money to change the laws to favor greedy corporations all on its own, while its competitors lie back and free-ride on its hard work. So they basically donate token amounts and do nothing. By all accounts the Koch brothers actually believed in everything they were doing, and they had to, because you couldn’t make billionaires spend Koch-brothers-like levels of time and money out of self-interest.
In this model, the difference between politics and almonds is that if you spend $2 on almonds, you get $2 worth of almonds. In politics, if you spend $2 on Bernie Sanders, you get nothing, unless millions of other people also spend their $2 on him. People are great at spending money on direct consumption goods, and terrible at spending money on coordination problems.
I don’t want more money in politics. But the same factors that keep money out of politics keep it out of charity too.
The politics case is interesting because it’s so obvious. Nobody’s going to cynically declare “Oh, people don’t really care who wins the election, they just pretend to.” It’s coordination problems! It has to be!
So when I hear stories like that Americans could end homelessness by redirecting the money they spend on Christmas decorations, I don’t think that’s because they’re evil or hypocritical or don’t really care about the issue. I think they would if they could but the coordination problem gets in the way.
This is one reason I’m so gung ho about people pledging to donate 10% of their income to charity. It mows through these kinds of problems. I may not be a great person. But I spend more each year on the things I consider most important than I do on almonds, and this is the kind of thing that doesn’t happen naturally. It’s the kind of thing where I have to force myself to ignore the feeling of “just a drop in the ocean”, ignore whether I feel like other people are free-riding on me, and just do it. Pledging to donate money (and then ﬁguring out what to do with it later) ensures I will take that effort, and not end up with revealed preferences that seem ridiculous in light of my values.
An interactive cheatsheet tool for the command-line so that you’ll never say the following again:
— How to run that command again?
— Oh, it’s not in my bash history
— Geez, it’s almost what I wanted but I need to change some args
navi allows you to browse through cheatsheets (that you may write yourself or download from maintainers) and execute commands, prompting for argument values.
brew install denisidoro/tools/navi
git clone http://github.com/denisidoro/navi /opt/navi
sudo make install
# install fzf: https://github.com/junegunn/fzf
Head to this playground for previewing navi.
* to increase discoverability, by ﬁnding commands given keywords or descriptions;
* to prevent you from running auxiliar commands, copying the result into the clipboard and then pasting into the original command;
* to easily share one-liners with others so that they don’t need to ﬁgure out how to write the commands;
* to improve terminal usage as a whole.
Sure, you can ﬁnd autocompleters out there for all your favorite commands. However, they are very speciﬁc and each one may offer a different learning curve.
Or you can launch a browser and search for instructions on Google, but that takes some time.
navi, on the other hand, intends to be a general purpose platform for bookmarking any command at a very low cost.
In this case, you need to pass the directory which contains .cheat ﬁles as in:
navi –dir “/folder/with/cheats”
Alternatively, you can set an environment variable in your .bashrc-like ﬁle:
Feel free to fork this project and open a PR for me to include your contributions.
* lines starting with % should contain tags which will be added to any command in a given ﬁle;
* lines starting with # should be descriptions of commands;
* lines starting with $ should contain commands that generate suggestion values for a given argument;
* all the other non-empty lines are considered as executable commands.
For example, this is a valid .cheat ﬁle:
% git, code
# Change branch
For advanced usage, please refer to the ﬁles in /cheats.
In The Legend of Zelda Ocarina of Time, navi is a character that provides Link with a variety of clues to help him solve puzzles and progress in his quest.
Want climate news in your inbox? Sign up here for Climate Fwd:, our email newsletter.
Greenhouse gas emissions from commercial air travel are growing at a faster clip than predicted in previous, already dire, projections, according to new research — putting pressure on airline regulators to take stronger action as they prepare for a summit next week.
The United Nations aviation body forecasts that airplane emissions of carbon dioxide, a major greenhouse gas, will reach just over 900 million metric tons in 2018, and then triple by 2050.
But the new research, from the International Council on Clean Transportation, found that emissions from global air travel may be increasing more than 1.5 times as fast as the U. N. estimate. The researchers analyzed nearly 40 million ﬂights around the world last year.
“Airlines, for all intents and purposes, are becoming more fuel efﬁcient. But we’re seeing demand outstrip any of that,” said Brandon Graver, who led the new study. “The climate challenge for aviation is worse than anyone expected.”
We’ve been harping for a while on the stark economic divides that deﬁne American life in the Donald Trump years.
To be sure, racial and cultural resentment have been the prime factors of the Trump backlash, but it’s also clear that the two parties speak for and to dramatically different segments of the American economy. Where Republican areas of the country rely on lower-skill, lower-productivity “traditional” industries like manufacturing and resource extraction, Democratic, mostly urban districts contain large concentrations of the nation’s higher-skill, higher-tech professional and digital services.
Yet now comes another wrinkle to the story. Not only are red and blue America experiencing two different economies, but those economies are diverging fast. In fact, radical change is transforming the two parties’ economies in real time. Which is a key takeaway of a new data analysis—published today—that we developed with the Wall Street Journal’s Aaron Zitner and Dante Chinni.
What do the new numbers show exactly? Based on standard economic data linked to recent congressional district outcomes that we have tracked over time, the Journal/Brookings analysis depicts above all the extreme pace in which the economies of the two parties’ districts are changing in this decade.
Some of the change is already familiar based on how the map of congressional vote outcomes has evolved in the last decade:
In the 111th Congress in 2008, Democratic-voting, often-urban districts encompassed 39% of U. S. land area compared with the 61% expanse of Republican districts. By the 116th Congress, just ten years later, the Democratic share had fallen to 20% of the map, with Republicans’ expanse rising to 80% of the nation’s land area. Certainly, those numbers point to economic change, although they also reﬂect gerrymandering and the low population density of rural areas.
In 2008, Democratic-voting, often-urban districts encompassed 39% of U. S. land area compared with the 61% expanse of Republican districts. By the 116th Congress, just ten years later, the Democratic share had fallen to 20% of the map.
Turn to our economic and demographic data, however, and it’s clear that a series of genuine, penetrating shifts have been happening at warp speed through the last decade. These shifts are massively altering the two parties’ economic identities.
For one thing, the two parties have in just 10 years gone from near-parity on prosperity and income measures to stark, fast-moving divergence.
With their output surging as a result of the big-city tilt of the decade’s “winner-take-most” economy, Democratic districts have seen their median household income soar in a decade—from $54,000 in 2008 to $61,000 in 2018. By contrast, the income level in Republican districts began slightly higher in 2008, but then declined from $55,000 to $53,000.
Underlying these changes have been eye-popping shifts in economic performance. Democratic-voting districts have seen their GDP per seat grow by a third since 2008, from $35.7 billion to $48.5 billion a seat, whereas Republican districts saw their output slightly decline from $33.2 billion to $32.6 billion.
Looking deeper, it’s clear that big shifts in industry geography and composition are driving the parties’ changes of identity. Look at the matrix of 10-year trends depicted here:
Democratic districts, for example, have grown significantly more dynamic in the last decade. Overall, “blue” territories have seen their productivity climb from $118,000 per worker in 2008 to $139,000 in 2018 as recent demographic changes and electoral sorting ensured they became better educated and more urban. Republican-district productivity, by contrast, remains stuck at about $110,000, reﬂecting only slight improvements of bachelor’s degree attainment and Republicans’ increasingly non-metro domain.
Relatedly, and equally striking, Democratic districts are rapidly increasing their dominance of the nation’s urban-tilting professional and digital services employment while ceding their historical, more rural shares of manufacturing and agriculture-mining activity. Just since 2008, Democratic districts’ share of professional and digital services employment surged from 63.7% to 71.1%, while their share of the nation’s manufacturing and extractive activities shrunk from 53.8% to 43.6% and 46.1% to 39.5%, respectively. Conversely, Republican districts—failing as a group to gain traction in the new sectors—have reverted to more “traditional” ones. GOP districts’ professional and digital employment fell from 36.3% to 28.9% of the total in just 10 years, for example, while their shares of manufacturing and agriculture-mining increased from 46.2% to 56.4% and 53.9% to 60.5%, respectively.
Democratic districts have seen their median household income soar in a decade—from $54,000 in 2008 to $61,000 in 2018. By contrast, the income level in Republican districts began slightly higher in 2008, but then declined from $55,000 to $53,000.
Related to these shifts have been dramatic demographic changes. In just a decade, Democratic-voting districts have become strikingly better educated and more diverse. For example, Democratic-voting districts have seen their share of adults with at least a bachelor’s degree rise from 28.4% in 2008 to 35.5%. For their part, Republican districts have barely increased their bachelor’s degree attainment beyond 26.6% and have meanwhile become notably whiter and older. Today, therefore, neither party represents the same types of places it did just 10 years ago. As such, the Democratic Party is now anchored in the nation’s booming, but highly unequal, metro areas, while the GOP relies on aging and economically stagnant manufacturing-reliant rural and exurban communities.
What might these divides look like in the future? It’s hard to imagine the current extreme shifts going much farther. The concentration of more than 70% of the nation’s professional and digital services economy in the territory of one party would seem to register an almost unsustainable degree of polarization.
At the same time, there are few signs of any coming reversal of the decade’s divergence. Instead, the current economic trends underlie the current party divide and reinforce it. For at least the foreseeable future, therefore, the nation seems destined to struggle with extreme economic, territorial, and political divides in which the two parties talk almost entirely past each other on the most important economic and social issues, like innovation, immigration, and education because they represent starkly separate and diverging worlds. Not only do the two parties adhere to very different views, but they inhabit increasingly different economies and environments.
“Blue” territories have seen their productivity climb from $118,000 per worker in 2008 to $139,000 in 2018. Republican-district productivity, by contrast, remains stuck at about $110,000.
And yet, perhaps there are possible meeting points. Maybe the urban, diverse, tech-oriented professional party and the exurban-rural party of older white males will ﬁnd common cause on the “future of work” at a time of spreading dislocation from automation and the spread of precarious work in ofﬁces as well as factories and warehouses. Perhaps Democrats worried about climate change and Republicans weary of storm damage in the Midwest and along the Gulf Coast will be able to work together on responses to extreme weather. And for that matter maybe the two camps will soon themselves become worried enough about today’s massive regional and economic disparities to engage.
Or maybe not. It could be, instead, that the nation is only heading deeper into a period of continued stand-off, where economic change reinforces cultural backlash, and both gerrymandered districts and the Constitution’s allocation of two senators for every state prop up the political power of a declining fraction of the economy. If that’s how the politics of the decade’s changing economy are going to play out, then political analyst Ron Brownstein may be right that the nation may be heading deeper into an era of sustained turbulence that “pits what America has been against what it is becoming.”
As HCL employees who work at Google like Johanne prepare to vote to join us Tuesday, they’re sharing their stories of why unions are needed in the tech industry. RT to wish them luck! #1u #USWUnity pic.twitter.com/bZYt0RaKcf
— United Steelworkers (@steelworkers) September 20, 2019