Welcome everyone. It's great to see such a cool room. My name is Sarah Stefano. I am a post-doctoral fellow in the Economics Department here at SOAS, and I would like to welcome you all to this seminar on behalf of the SOAS Research Cluster on Food and Nutrition Health in Development. This is a new research cluster led by the Economics Department bringing together students working on issues of food, nutrition and health in low and middle-income countries. So, the research cluster is led by Professor Jane Harrigan who is here and also by Dr. Delver Johnson who unfortunately is not able to be with us today because she's busy. So on behalf of the cluster I would like to welcome Professor Tim Lange who is very pleased to have him here as the speaker of our first public seminar. Tim Lange is Professor of Food Policy at the Centre for Food Policy at City University London. I'm sure many of you are familiar with a lot of his work. He's been working for many years on the relationship between food, nutrition and health with a specific focus on policy, if that's correct. So I'm not going to mention all of the roles that Professor Tim Lange had, but I want to say that Tim was a food commissioner on the Sustainable Development Commission between 2006 and 2011. And a member of the Council of Food Policy Advisers between 2008 and 2010 is currently a member of the London Food Board advancing at the mayor of London since 2009. He has written extensively on the subject. The one thing that I want to mention is that the talk he's going to give today will give us a flavour of his new call for food, sustainable diets. The title is right there on the first slider. Perhaps I should also say that some of his very recent work is on Brexit and food policies, so any of you interested in this subject should check out his work on that. Now we'll hand over to Tim. The way he's going to work is that Professor Tim Lange is going to speak for about 20-25 minutes.  And then we'll have time for questions and answers. So this should last for about an hour from now. Okay, over to you. Thank you very much. Thank you very much. When I was sort of... I couldn't remember whether I said to Sarah I would do any slides at all, but now I'm regretting it actually because I think I've done about 40 slides. It creates all the rules that one should do in 20 minutes. I'd actually forgotten it was a 20 minute. But I mean I can say what the talk is. Now we can go to sleep and work up in 25 minutes. Basically, this term, sustainable diets, has come in to mean diets which are not just good for health, but good for the environment. That's the simplistic view. We in our centre tend to champion and explore the more complex view which I'll talk about, which is that it's also culture, it's economics, it's other things. But essentially why we're talking about it is because food is the main driver of climate change, water use, we've got Tony Yalham, my guru here in the room at the front, from the sides, and King's biodiversity loss. You name it, food is the big factor. It's the big factor in non-communicable diseases. It's the big shaker, it's the biggest employer on the planet. If we don't sort out this, essentially we're in very serious trouble. So this term, sustainable diet, has come to be a code for thinking through the consumption end of the food system. So I'm a food systems type of thinker. My friend Ben found here, so I was also likewise where we were young when we started, but now we're the old fucks. Sorry, not in Ben's case, but it's a young fuck, where we've been doing it for 40 years, trying to apply a new understanding of how food works and the supply chains and what it means and the inequalities of power. So when I use a term like food systems, I'm meaning a structural analysis, not just a sort of a narrow dietitian's view or something. I tend to do headline, chapter, headings, or like this. So what's the problem? We can do this very quickly. I've said it, it's basically health. The evidence about this is now just overwhelming. We have a problem of overwhelming evidence not being answered. That's our problem. The problem is not what's going wrong. We know what's going wrong. There are some bits that we're arguing about but not much. And it's immediately, I think, a complexity problem. You can go, what I do as a generalist, as a policy analyst, and go across all of these different disciplines, different takes, and essentially in all of these, the problems are coming up. The slides are for you, so I'll go through them very fast. I mean, just start with health. If there's one thing that gets people's attention, it's usually health. I mean, food is the cluster or the cross-cutting issue that explains the cluster of the main causes of disease. The global burden of disease done by the World Bank and the World Health Organization initially has been updated many times. The methodology changes. It doesn't matter whether you look at standard epidemiology or look at global burdens of disease and dailies and quarries and all of these metrics. It comes out that diet is now actually the biggest factor. It causes all these deaths, but what's involved is this key notion my good friend Barry Popkin planted about 25 years ago, this notion of the nutrition transition. As fast as we get this evidence, the world carries on going through the nutrition transition. It's eating differently. The moment we get more affluent, we start eating like the rich, or how only the rich is to live, and the result is a very contrary public health world. The costs are just astronomical. I'm not someone as Ben knows only too well from discussions we had well 30 years ago. I'm not someone who thinks that economic factors shape what politicians and policymakers do, because here, for decades, we've had evidence of the costs of ill health, diet-related, and yet the food system carries on churning out overproduction, malproduction, malconsumption, and externalised costs. If the evidence from the communists really did have an impact on policy, the data would surely overwhelm it. And the big thing is now that the costs are in the lower middle income areas, exactly your area. The rich world is barely afforded that the middle and lower income countries cannot. This is away from that area. This is, again, my good friend Johann Rockström and well Stephanie in Australia, Rockström at the Stockham Resilience Institute. This work that they're looking at planetary boundaries, not as food, but just looking at how is planet Earth doing, and basically it's not being very well, and across all of the main boundary issues that these interdisciplinary scientists are looking at, these planetary scientists are looking at, food is a cancer of about 60%. It doesn't matter where you look in the evidence. If you look you're getting more honed into food, the FAOs, livestock's long shadow report in the mid-2000s, and then updated by also Steinfelter, I know, good agricultural economist who's head of the Division of FAO, they redid all the data and found, whichever way you look at it, particularly meat is a driver of greenhouse gas emissions. The FAO was trying to give a positive spin to all of this and saying, look, the best farmers with the lowest emissions, the best management of emissions can reduce emissions from capital by 30%, but then on page 43, I think it was, if the world carries on eating more meat, all of those efficiency gains are better. In other words, somewhere along the line a big issue of livestock has to be addressed. Whether we look at it as national level, by land use, by different types, Brazil, they can chop down the whole of the rest of the Amazon, but it's still actually, there's a squeeze on land, this is grid, grid arendall data, I was looking at India, because I was a child brought up in India, and you just see that, this is by hectare, Brazil's got four and a half hectares per person in population terms, India about a third of a hectare, and then you look at the land use, forest pastures, cropland and other, cropland is the interesting one, because that's plants, that's what we really depend on, and if we spend our cropland feeding animals there, we're making cars to compete with us. That's problematic in India for religious reasons, as I'm sure you know. There is a very big difference in different regions of the world, different nation-states. We've got Tony here, you know, this is one of my standard slides from Chapkin and Herkstra, you know, the average westerner eating one burger, you know, a hundred gram burger is basically using two and a half thousand litres of embedded water. This is, you might say, OK, that's fine in white Britain. We'll actually get real, Britain is not white actually. The south-east of England is water stressed. In north Wales, where part of my family are from, it is white. So what are we talking about? Relocating where we grow animals. If we grow them, what does it mean? Well, you can't grow wheat on the mountains of Snowdonia. It's wet, but it is not a great place to grow and harvest serials. So if you're feeding serials to your animals, which is what the world does, this is a problem. This is the squeeze, the notion of squeeze. Thinking of here a lot, here are the figures on rice, you know, I had cancer about 12 years ago and all I wanted when I was in the hospital having operations was to eat my childhood food of the rice and dal. I mean, psychology has gone wrong, why should not be surprised by this? The rice and dal is actually very heavy. Well, the dal is not so much, but the rice, well, look at the embedded water in the rice. If there's one crop that comes out as under threat from climate change, it's actually rice. Meantime, on the social dimension, we've got 1.7 billion people overweight and obese, and only about 1.9 in Hungary. This is a messy world. We've got this nutrition transition going on, sweeping into more and more what the great Brazilian nutritional epidemiologist Carlos Montanero at Sao Paulo University calls ultra-processed foods, a shift from simple diets to ultra-processed diets which are made in factories with the fats and the salts and the sugars and what we, in my world, call the new adulterations happening. This is a shift which has been an indicator of success. Don't let's forget that. And it's happening very rapidly. This is from my colleague and indeed my replacement as director of our Centre for Human Policy at City, Corinna Hawks, co-editor of the World Nutrition Report. This is from the Globe panel report that she corrode for the Global Panel of Experts on Agriculture that came up a couple of months ago. This is worth looking at. Lower income, middle income, sort of upper middle income and higher income. The blue is ultra-processed foods just in every area except the high and the high income countries like Britain, the United States, the OECD, rich elements of the OECD, consumption of ultra-processed foods is leveling off, but look at the level it's got to. And it's this that worries us, this upward rise. And indeed the shift from cooking food to receiving pre-prepared food is a key part of the picture I'm painting to you. You can look at these later. This is from Carlos Bonteras, a paper as well. I'm going to go through this faster. To get into the economics, don't let's forget, actually I regret putting this slide in because I've just done a better one of literally figures of the prices since the 1860s. Essentially food prices have come down over the last century and a half in world terms and in rich countries. It's varied by country and varied by circumstance, but this is the FAO Food Price Index over the last 50 years from 1961 to 2016. Initially last month, so it's pretty up to date. And you see this is basically the banking and oil crisis. And if I had done a logograph I'd have shown you World War I, World War II, but it went up and then it was oil. It's moved from war crises to oil crises. And sometimes they're the same. Here's a nice way of showing it's not just food, but how oil peaks. Here is the early 1970s. So agriculture fertilizers and energy process and you see fertilizer rockets for the moment I think. And it's fertilizers that has given big increase of output for the last 70 years. It's not? Agrochemicals is fertilizers. This is a long slide, a lovely piece of work done by USDA, ERS, which I really like. You can look at research services over 100 years. Basically it was in 1909 to basically 2000. You could see how the U.S. actually, the U.S. had very high availability of calories in the 18th and 19th centuries upon the reasons people emigrated. And it got squeezed actually, but then it rose too in the United States. It's all in the second half. Post-Second World War we're dealing with what we call the New Food Revolution. It's the productionist paradigm. Or the next colleague of Ben's, Michael Eastman, and I wrote a book called Food Wars. If you want to look at it, a new edition came out last year. But what is interesting is that in the amount of money over time, this is from 1929 in the states to 2000, the amount of money people spend in the nutrition transition goes down, even though in real terms it's going hard.  I've said this really, but I really want to stress this on sustainable diets. Look at this later and I'll put it in actually, because here we are, so else. The meat eating, the top meat eating country, the thing that governments do not want to face is meat. They just don't want to face it. And you can see why when you start looking at where the high meat consumption is. I'm not going to go into that any more details. It's not just meat, by the way. There are very different pictures. This is from great studies by Ripple and colleagues. Different animals have different emissions.  But the problem is ruminants rather than rice, but rice ain't particularly a good diet. This is why the theme I'm giving you is sustainable diets. Is it just simply nutrition plus environment or is it nutrition plus culture plus price plus social issues? I think it is and that's what I've come to say. I think we cannot address the challenges that are coming from the evidence about the food system unless we get a grip over what, with our panelist and Michael and our book, a multi-criteria approach to sustainable diets. So what do we need by sustainable diets? Well, one of my heroines, Joan Gassau, a very nice woman, still alive, a nutritionist at Columbia and Kate Clancy, a PhD student who first wrote a very short paper in 1987 where the term was first coined and it's sort of ground. I was an immediate early fan of it and basically what they meant by it was nutrition plus environment. Joan, a very keen organic girl, now her husband, she's a wonderful woman. She was thinking about ecosystems, things as any of us from the 1960s do and the most pared down, when I sat on the government's kind introduction and I was on various committees at the end of the Labour government when the banking oil crisis had happened, they suddenly panicked and said, my God, we've got sought out our food problems, that's just no income, it's us. And we had a huge fight inside the British state machine over some reports called the Food Matters Report, if you're interested in it. What I was across Whitehall was that the British state would say, the British food systems got a shift to address nutrition plus environment or actually heart disease plus carbon. So that was the compromise and the food industry was, enough of it was prepared to buy into that and actually we were prepared to compromise saying, okay, that's good because if you lower carbon you're lowering meat actually and you're doing all sorts of other things. But the evidence in this very quick course tour I've given you says that it's more complex than just nutrition and carbon. It's culture, it's people's aspirations, it's what they want, it's their pleasure, it's their social dynamics to food. I'm a social scientist, I suspect, so maybe you want to. So it becomes, as you've already read here, the issue of sustainable diet, institutions, John Gosar and Kate Chansey did their paper 30 years ago is complexity. But that in political terms and policy terms is tricky. No politician wants to say it's complex. They want something very simple. So I'm now speaking as a pragmatist. Someone who's had to be inside a machine but also studies it. You can get a toe in the door with a simple issue, and as long as you're dragging the complexity behind you, fine, then you get changing. We're actually beginning to do that. But that's a different talk. I had the pleasure and privilege of co-chairing the FAO's report, sorry, FAO's scientific symposium to review and think about sustainable diets. And I chaired the element strand of that which came up with this definition, which I'm not going to read out, which is now obviously highly cited. This is the UN, so it's quite useful. And you can see the complexity, you can see certainly mine, my job is to steer this last group of people into agreeing something that's multi-criteria. So it's moved on from Kate Chansey and John Gosar. Well, but this is the difficulty policymakers have. There is an evidence policy gap, is the picture I'm giving you. If you think policy is made by evidence, grow up. It's not how it is. Sometimes evidence is very important in policy. Very often policy is completely in all's evidence. And that's not just a conspiracy, very, very rarely is it, a conspiracy. It is much more that there are bad champions, no one's organising it, no one's articulating it, it hasn't been translated. There are other dynamics to the policy making. But the reality is we have a lot of evidence policy gap. We've got a problem which is for 17 years the food system has been asked to do what it's done. Produce more, intensify, enable food to get cheaper, feed people's aspirations, on every store, on every corner. This is liberty. Professionally part of the problem has been that the academics were also driven, I don't need to say that in Britain, were all reft and now little silos being judged for how successful you are. Work harder is always rule number one. This is bonkers. When actually we need to put across the evidence, walk across the evidence and put it together, that's what we should be doing as academics. So it's been a half. We've not had any. And I think the problem for me, I genuinely will think, but I think it was a political failure. Not just a political failure of academics, it's a political failure generally. But I'm going to give you some good news from that. In a moment. Well, it is complex. But then you go to Qatar, which I can never say the most correct. Qatar. Whichever way I say it, it's wrong. There's Qatar. It's got sustainable dietary guidelines. Did you know that? It's astonishing. My PhD student was the person who wrote them. His is the recollection. But the interesting thing is, hey, do they practice it? Well, that time will tell. We'll see what difference it makes. But why and how did that happen when the United States last year rejected turning its five-yearly reviewed dietary guidelines for Americans, which the scientific advisory group had worked for two years and produced, I think, a 500-page report on the reasons why there should be environmental factors in the dietary guidelines. The Secretary of State for Agriculture in the U.S. turned it down. 35,000 submissions were made to the consultation process. I don't know how many, but let's be charitable. Maybe 1,000 came from the food industry. 33,000, 32,000 were from everyone else, saying we want them to become sustainable dietary guidelines. But the Secretary of State for Agriculture outvoted the Secretary of State for Health and the dietary guidelines for Americans ignored in line. So the biggest emitter of diet-related greenhouse gases put its head in sand. So we've got the Democratic evidence-based scientifically literate America says no, but Qatar, a small oil, delivers something. How has this happened? That's very interesting politically. What Hamila Mason and I have done in our book has ended up saying, OK, well, we are where we are. We've reviewed lots of different things. Different governments tell the story of the Americans and Qatar. The most interesting story of all is Sweden. Sweden was the first country to produce evidence-based sustainable dietary guidelines in 2008, 2009. It's Environmental Protection Agency and it's National Food Administration, so it's two scientific bodies worked for a year and a half, two years and produced a report published being in Sweden. Everybody's in the open. They're environmentally conscious, environmentally conscious consumers. Being good Europeans, they submitted it to the European Food Safety Authority as there's an overarching responsible body of the European Union who told them to remove them. This is a very marquee bit of politics. It is strongly suspected that a very big American meat company, Smithfields, then owned by the Americans, now owned by the Chinese, which had bought all the former Soviet Union and Polish meat interests in Eastern Europe, lobbied through the Polish government to get them withdrawn. The reasons for them being withdrawn is that the Swedish dietary guidelines said if possible to eat locally and eat seasonally, and that was against the single market. Well, that's maybe an ostensible reason, but the point is in Australia something very similar happened. In Britain, we started going down the route as the era I was involved and then the coalition government came in and stopped in the first month after election. It stopped the project of creating integrated advice for consumers, linking health and environment being done through the food standard policies. And then why is this going on? What on earth is wrong with saying to the public in rich countries, poor countries, actually we've got to eat within environmental limits for health, for culture. But apparently this is very hot politics. So, the journey so far, I think just the evidence is going on. If you use a tide analogy, there was a rush up in the late 2000s and it's been driven back, but it's building up. Actually not at the national level, but at the international level and at the local level. A very interesting move happening at cities. I was in Milan in October on World Food Day, October the 16th and the day before we launched the Milan Urban Food Policy Act which was signed by 100 so-called world cities. Actually it was very moving. I'm not easily moved, but I was moved actually. We were in the building that the British bombed when trying to drive the fascist sort of Italy in 1944, 43, 44, which the Italians had restored very beautifully right next to the Milan Cathedral which is a stunning building if you've never seen it. The Italians decided they would not rebuild it but they would restore it so that it was safe and that's the key meeting hall of the city. So here we are in something the British had bombed, but all over the world there were mayors from Shanghai, Beijing, Copenhagen, Melbourne, every continent except Antarctica. I won't go into here, but we've got at the global level we've got this really interesting slow growth at the UN level. We've seen two international conflicts on nutrition, the Sustainable Development Goals passed last year and signed and now ratified by half of this Mr Trump turns them up, which he might, or what he might, you cannot deal with the 17 SDGs unless you deal with food. You can't do it. In which case the picture I'm trying to paint is the move for sustainable diets is inexorable unless it's political. We've got experimentation happening at the national level, but not getting anywhere. No country except Qatar has it. Sweden was made with druids but then came back with new cultural guidelines so they didn't give up, which was terrific. But actually the enthusiasm is down here and I've put the link there if you want to look at it. There's now 120 cities signed on. So what are the issues arising? Why does this matter to so has? I think because, well, for people like me there's a very important issue, formal versus informal guidelines, the difficulty of multi-criteria approaches, which we can talk about more, but what can LDCs do? If you don't know the literature, bit by bit, I am very heartened because this used to be a discourse that was seen as the rich consumer world. This is where fancy people inhabited. But it's not if your country has a massive NCD, it's non-communicable diseases. It's not if your country is in the front line of climate change and that's why this is becoming a hot development issue. If you don't know them, the ODI reports are good. I've put them there. Here's Qatar and here's Brazil. I think Brazil has made an absolute blinder on this. Their national dietary guidelines review was led by Carlos Montero conveniently and he, who we're close with, gets the point and starts to the brief that this was revising nutrition guidelines but proofed them against the environment. Didn't make them sustainable dietary guidelines but said, actually, if we follow the nutrition guidelines we're recommending the environmental footprint will come down but they sold it to the ministry and to the Brazilian public on cultural grounds. And here they are. And this was the blinder. You can look through these later. I mean, essentially they're talking in very everyday language, which I like. And this is the official, passed by the minister of health. Avoid fast food chains. Think very carefully of some things being advertised. You know, these are the messages that actually are needed if we're going to address the enormity. Be critical of commercial advertising and food products. Whoa, is this boy happy?  You know, we talk about democracy and power. Actually, over food, it's a walkover. Now, don't lose sight. There are very powerful faucets. Here's one of the richest men in the world going down the route of funding that based meat. That burger cost a quarter of a billion dollars. There are all sorts of possibilities to deal with the objective evidence I started with. All sorts. So don't lose sight of those. But I think what's interesting is if you look at this issue of sustainable art through the multi-criterion lens, you'll see that there are very interesting pressures building up on all sorts of fronts in companies. I always say that PepsiCo is my second least-favoured company on the planet. If ever I meet anyone from PepsiCo, I say, I really want you to go bus tomorrow and then we'll be feel better. For some reason, they don't take any notice of me. But they did astonishing things in Britain. They're experimenting in this 50 in five. They've reduced the greenhouse gas emissions in Britain as an experiment by 40% in five years. I mean, you have to say that's quite interesting. Now, why are they doing it? They're doing it out of self-interest. It's not out of nationalism. They want to be around.  This is the biggest pasta company in the world, Barilla. These are very famous. They're actually very good. And it's a really extraordinary company. In some respects, they get the point. They've done this inverted pyramid. So there are lots of things. I mean, here, companies replacing the state is giving guidance. This is messy. We're not happy with this. Actually, they're the type of people. Different countries have been doing different things. I've told you that. The biggest conservation body in the world, WWF, concluded six years ago that if it really was bothered about pandas, albatrosses, and polar bears, it had to help stop the nutrition transition.  And it's extraordinary what they're doing, actually. It's very interesting. And I love this sort of world of where localized experiments are going on. It's civil society. I'm almost there. What have I said? I've painted a big picture, which I don't apologise for. I think we're at a point where we have to review history for the last 70 years. The productionist era. The second world war reconstruction of agriculture has been highly successful, but highly damaging. And we now know enough that this has got to stop and it's got to change, and the consumption element of that has to be a face. You can't just deal with it at production. The sustainability of consumption is a key, if not the key factor. I think we end up, and that's what Pamela Mason and I end up in a book, talking, saying this has to be what we've called the SDG-squared strategy. Sustainable diets, dietary guidelines to meet the sustainable development goals. And that requires, you know, broad front politics, but it actually raises very delicate and very hard issues that are as old as food issues, namely democracy versus control. And that's why I poet Qatar versus America. Just think of the politics of that. It's not lost on you, I'm sure. Okay, that's it. Thank you very much for giving us such a big picture. I'm sure it's true there's... I'm sure it's true there's lots of thoughts. Sit down, please. I'm going to sit over there. And people will have many questions to ask, so we'll start with our discussion. Professor Jane Harigut, who's a professor of economics here at SOAS, some of her recent work, work has focused on food policy in the Middle East, but he's clearly looking at the role of food prices in the Arab Spring and the following shift to food sovereignty in the Middle East and in the Pacific region. I just wanted to say a couple of things. One is that for those of you who use Twitter, you're welcome to tweet and use the hashtag SOASECON. And also for those of you who didn't get the chance to get tea or coffee before, there will be chance after we end the seminar, so don't worry about that. Thank you, Tim, for a fascinating talk. It's a shame we couldn't let Tim speak for longer. I've been lucky enough not just to listen to Tim this afternoon, but also to read the first draft chapter of his forthcoming book, which is also called Sustainable Diets. Again, it's a shame that that book's not out, I think until May, March next year. It's always a shame that publishers take so long to get these books on the shelf once people have delivered the manuscript, but I urge you all to go and buy a copy of that when it comes out in March. I certainly will be published by Routledge. Borrow it. Or borrow it. Yes, it might be a bit expensive. Anyway, thank you, Tim. The three key and critical insights I took from both Tim's fascinating talk and reading the introductory chapter of his book was firstly how topical and pressing this issue of sustainable diets has become. Secondly, how we've ended up in a position that is so far away from sustainability in terms of what we eat and drink. And thirdly, how complex the concept of sustainable diets and associated issues actually are. So those were the key three key messages I got today and reading the chapter. So I want to talk about each of those three issues very briefly before we open it up for a discussion from the floor. Pressing. Why is this such a pressing issue? Well, I think Tim's made it very clear that if we continue to eat following the sort of North American, European dietary pattern, and if middling come and lower income states continue to aspire as many people in those countries do to those type of Western diets, then the implications are quite devastating. They're devastating for biodiversity, they're devastating for climate change, land and water use, food availability, food waste, public health, and much, much more as well. And I think Tim, particularly in his book really makes a powerful case that we can't ignore this any longer and if we do so, we do so at our own peril. Now, he provides some fascinating facts and figures, we saw lots of them up on the slides to drive this message home and they all make for pretty alarming and depressing reading when you look at that data. But a couple of the key figures that really stuck in my head, some of which Tim presented today, some of which are not today, but in his book. Well, firstly, around 1.7 billion overweight in these people globally, that's a staggering figure, resulting in the fact that between 2010 and 2030 the estimated cost of non-communicable diseases related to diet, that seems like, diabetes, strokes, heart attacks will be roughly 30 trillion US dollars. That's about 48% of 2010 global GDP. That's a huge, huge global cost. Another figure he gives us and most of that hitting middle income and lower middle income countries that can least afford that huge healthcare bill and other associated costs. So, another fascinating figure, agriculture emits over 13% of all greenhouse gases. Another figure that really, really struck me, I had no idea of this, even though I work on food myself, 220 million tons of food waste globally a year doesn't mean much to me, but when Tim says what that's equivalent to, it's equivalent to the annual food production of South Saharan Africa is wasted every year. That's a stunning figure. And approximately half global cereal production goes to feed livestock in order to satisfy our desire for meat and dairy products. Some of these facts and figures really drive home the position we're in at the moment. The second thing I think Tim does, he didn't talk so much about this today because he had very limited time but I think it's done very well in the book. He traces the way we actually have ended up in this position. So, he talks about the huge increase in food production since the middle of the 20th century, but also the fact that this has been combined with an ethos which supports the idea of development as being rooted in the market and consumer choice. In other words, what he calls the industrialization and the marketization of food, which is all part of sort of neoliberal thinking and ideology. So, at the same time, he argues that power over land is no longer residing with agriculture itself. It now resides with traders, processors and retailers, the big food giants who work off the land and who help shape what we eat and drink. But what he does in the book, which I think is fascinating, he shows that the drive to produce cheap food is not really cheap food after all. It has what economists would call major externalities, in other words, external costs that are not usually captured by the market price of food. And to quote from his book, he says, cheap food isn't cheap, extra costs like elsewhere. So, he traces how we've ended up in the particular position we're at right now. And then finally, he tells us what sustainable diets really mean, and he sort of carefully unpacks this concept of sustainable diets. And as he mentioned in his talk, this concept goes beyond the earlier simplistic definition where you just combine healthy diet with a concern for the environment. And it's a much more complex concept than that. It involves things like culture, costs, values, production, social norms, governance issues, et cetera. And he argues and shows how the idea of health and the idea of sustainability are as much social, cultural, economic and policy constructs as they are simply technical issues. And again, to quote from his book, he says, a sustainable diet is one which optimises good sound food quality, health, environment, socio-cultural values, economy and governance. And he uses those six-board categories or those six-board headings in his book to provide the structure for the analysis. So he gives us a really good feel for what we mean by this concept of sustainable diets. And then the final issue that sort of I thought was a key issue that came from the talk in the book, and this is perhaps one we can discuss more in a second, is what is stopping the transition to more sustainable diets and how do we overcome those barriers and move towards greater sustainability. And here I want to press Tim a little bit and ask him for some views on various issues. He shows this is not just a fringe importance and it's not just a technical challenge, it's a cultural challenge as well. And he also argues that the gap between evidence, policy and behaviour is widening, not getting smaller and asks how can I stop this. Well, this is a question I'd like to pose. How can we actually get the change and the movement towards more sustainable diets? And I recently had a fascinating discussion with Bea Wilson, who some of you might know used to be the food columnist in the Telegraph. And she actually has argued in some of her writings that things like national dietary guidelines and a public health approach to changing our diets where government gives the populations messages, gives them guidelines, dietary guidance. It doesn't actually work in the sense that the message gets through. We all know we should be eating five food and veggie day. We all know it's bad to buy things with a traffic light symbol in the supermarket that has lots of red and green on the little circle for fat, sugars, unsaturated fats and such. We all know that, but very few of us really act on it. It's not significantly changed our behaviors. So she's very skeptical of some of the initiatives that Tim was pointing to towards the end of national dietary guidelines, government public health messages to get us to change the way we eat. And she actually approaches dietary issues from a psychological perspective. She argues that eating is a learned behavior. Humans are one of the only animals not built within innate knowledge of what is good and bad for us to eat. We learn it as children. And her approach is a psychological approach starting right off in the earliest years of childhood that we need to learn how to eat sustainably and we need to learn how to eat healthy diets. And she's talked a lot about fascinating experiments in schools, particularly in some of the Scandinavian countries, to try and get children to change their whole approach to eating and diet. So I want to press him a bit in terms of asking him what his views are, particularly on this idea that public health messages, sustainable dietary guidelines are not necessarily the most effective policy measure to get the change we need. And if they're not, what are the alternatives? How can we really get these changes? I mean, you mentioned towards the end perhaps it's the big food companies, the companies like Barrilla who might, with the right kind of pressures, see it to be in their own interests to change their behaviors, their advertising, their marketing. Is that the way forward if national guidance from governments don't work? Or is it something which is a much more individualistic approach based on the psychology of eating which really involves educating parents, going into schools, the Jamie Oliver sort of approach. So I'm quite fascinated to hear more about how we operationalize this whole concept of sustainable diets and how we actually get the change that is really necessary to address the questions and the dilemma or the crisis that Tim has so eloquently outlined for us. So I'd like to ask Tim that and I'd like to hear from anyone. Thank you very much indeed. The bad thing about coming to someone like so else is you get lovely discussions. You get to the heart of the matter. I couldn't have wished it were something better than that. Thank you. Well, you've got it. That's exactly the problem that we pose in the book. And that's why I was in a low key way saying what our answer is. There's no single answer. I mean, I know, like in Mexico, I mean, Wilson, I've just had spent an evening discussing and debating with her. I know for years and I'm a great fan of her writing.  Our answer, my answer, both in the book and generally after 40 years of thinking about this, is that there's no one else. I mean, as I reminded B as a historian getting interested in the psychology, I had a PhD in psychology and got interested in the structural issues. The answer is everyone always says their area isn't the answer. And that's right. It's because it is a multi-criteria, multi-level problem. And that's where actually I'm going to defend sustainable dietary guidelines because you'll only get the multi-level, multi-factor interventions, multi-agency interventions, multi-actor interventions if you have the framework which is agreed to be necessary. And that's what we mean by sustainable dietary guidelines. It's about saying that the framework for food for the 21st century has got to be about linking the six criteria that we pose and frame the book around quality, health, environment, social values, economics and governance. And those six headings bring order to what at the present the neoliberal experiment of the last 40 years is chaotic. That we know. But we're not going to have a single answer. We just said within the social area of our six headings if we just focus on child education that consigns adults to what? You know, everyone is always happy you'll get political movement around children always even the most recalcitrant andy and estate person wants to look after their children just. But actually we've got to address population change in the next 30 years very rapid. It's taken 70 years to get into this mess but we've got possibly 20 or 30 years to get out of it. We can't put all the emphasis on reteaching children because that won't deal with the population the population exposure. So that's the first point. The second point is what I said earlier I think there are lots of interventions that are possible. What we have to do is coordinate them. Thirdly, as an academic I've started our masters that we've run that city that's doing the world's only master's programme in food policy or there are a few others about to start up I'm about to say around the world because I mean this is the big issue why is there just one master's programme on food policy? I've said I will start our course by saying what's the evidence for population doctor change? Have a war. Have a war. That's the time that populations at population level change. And it's the time at which state and capital interventions occur. That's a very soda I can see all the brains going the camera should be the camera should be looking at your faces I mean I'm not saying have a war but I'm saying it's at moments of total crisis that possibilities have been changed occur. Indeed, the productionist paradigm we're in was articulated policy ground sees in World War II actually it's a very good demonstration but at the domestic level crises are moments where people change. When people have a heart attack they start thinking about their diet that they didn't think about before when one of their loved ones has a heart attack they're more prepared to but then that's just one individual to pick up one of your points change. The individual level of change is not enough. It has to be as the great epidemiologist just the other side of the square Geoffrey Rose in the University College always said his U shaped curve we are here over here the mean of fat consumption in countries like Britain is 42% of calories from such a different fat we need to get it down to about 20, 25, 30 do we target those who are at the top and try to get them to become reformed and eat us? Well actually you've got to move the whole curve so it's got to be at the population level it has to happen. You'll always get variations in populations even in authoritarian states even in rationing circumstances so the questions you're asking are absolutely right but our answer is there is no one answer it has to be multi level multi intervention point action so it has to be structured Thank you very much Shall we take some questions for the audience? We're just clearing our throat May I please ask you to keep your questions or comments fairly short because we're very concerned Does this resonate with you? You all look like you're interested the camera won't be able to show they're looking very interesting I always expect everyone to give you a sleeping up or lunchtime so that allows me to berate so as for having biscuits biscuits God damn it Questions? Questions Comments? Rude remarks I'm just over at the level of hygiene and tropical medicine I'm a master's budget nutrition for global health but I have a big interest in policy assessment and my question was you mentioned that we have to walk across the evidence and that there's been a bit of academic failure and I was wondering what you meant by that if it was in the way we're teaching nutrition to the up and coming people who are going into policy or if it's that we've taken maybe too high a brow Can you stand on that? I can I'm actually delighted you picked up on that because I think I'm at the stage of my life I'm about to be 69 and I've stood down as a full-time running on centre where I think I'm sort of looking back at everything, what have we done what's my generation done well I think we've helped get these problems onto the agenda we have little moments of where the tectonic plates have shifted we have little moments of entry but not enough has changed a lot has changed but not enough has changed and I put that bit in that slide because I think part of the challenge we've got at the moment is we're not good at inter-disciplinary and that is always a problem, you don't get rewarded for it, you don't get the Nobel prizes in inter-disciplinary contributions of this sector or that sector I do think that is an issue I think most people you know the former head and the current head of the school of hygiene are actually very good on this point they understand and know that the huge public health calamities the world has to address cannot be resolved just by doctors or by drugs they do require multilevel multi-hectare multi-disciplinary interventions so I think education that means we need to have that element built into our programs more I don't think we do that well I think we need to reward it I think it's very hard to be an inter-disciplinary academic the notion of policy is one of the few areas you can get that actually from the range across although still the pressures are that you specialize in one area I mean to some extent cakes will always be cut up in slices in different ways you can't do everything all of the time so one has to be grown up about it but it is a very important reminder of the need for specialists that we do so well in this country and in Europe specialists need to have some education in to know what they don't know and to be prepared to work with others and to know that most of the problems that we all deal with cannot be resolved on our own by our expertise if they listen to it all what's your view? No absolutely I'm from the US and I've brought up my whole life to specialize and choose majors and a particular track and now I finally feel like I'm on a track that is interdisciplinary to a certain extent but there is a pressure to specialize, specialize, specialize and you certainly close yourself off to other views and you certainly can't tackle an obstacle like the current food crisis without taking in all the different components for doctors, there isn't just a miracle through I mean that's absolutely right people like me, social scientists have gone wrong, drawn to public health because public health is actually the history and reality of public health as it has to be interdisciplinary public health, Geoff Rainer and I in our book Ecological Public Health we're called it, reframing the conditions Thank you very much Sophie Fiorella, Matteo and Ben who are members of the Sauras class on Food Nutrition and Public Development for the contribution to the organization of the Serial and Astana Finian who's our poster the Long and Middle East study in this room in this part of Sauras and thank you all for coming I really enjoyed it I thought I'd save you having to Thank you I would like to thank you to Sarah who has actually been headed up by Sarah who's really been a huge driving force in getting the cluster off the ground and pushing ahead in organizing this first very successful event so thank you


My name is Michel, and in reading back on the description for this talk, they thought about people must be thinking about what kind of talk is this going to be, and what kind of words is there to talk about, that's specific to payments on October 10th. And also, if you read the description, probably some of you might wonder about whether I'm going to complain about some aspect or another of rails, kind of the kind of complaints often hear from people that have not yet achieved the state of nirvana of two rails last time. So I definitely have not achieved that, and I will complain a little bit, I think. But I hope that you agree with me by the time I'm done that some of the straight-off that I'm going to present are worth making for any of the million payments in the world. So I'm going to tell you about my experience in building, or more accurately, participating in the building of a few different payments for several large companies. Most recently at Airbnb, I've tried to take some of those, some of the experiences and turn them into best practices, and try to share a few of those with you. And yeah, even though I might complain a little bit, I think I started my journey not really thinking that rail was the right tool. And I have to admit that I now am confident that this is the right thing and that using rail for payments is doable with self-accompaniment that I'm going to talk about. So I want to start over a decade ago when I joined what is now the largest successful payments company, which is then a startup that has just been acquired by one of Silicon Valley's successful companies. That startup was in the middle of Oxford, and it was hiring lots of engineers to help it sustain its growth and create the foundation for the future. And pretty quickly after joining, it became clear to me that there's tons and tons of work not just because there's lots of features to be implemented, but because folks there just did not have the time, they didn't have the inclination to focus on long-term thinking. It's not that they were smart or had the wrong motivations. They were just focusing on survival and growth. And what it felt like to me was coming in to find that your roommates have been partying all night and they've left the house in complete disarmament. They emptied the fridge, they left a mess in the kitchen, and tons of medication. And if you go around, by the way, you might find fewer examples from the Airbnb's past. I think that's a topic for another day. And now, you know, the kitchen needs to turn out a lot of gourmet meals for a very long time. So it's a little bit of a problem. And that really brings me to the next point, which is any company, any tech company, no matter which phase it is in, can and should think about quality. It should think about reliability, destability, maintainability, and those are all things I'm going to touch on later on in my talk. And I think it's especially true for companies or organizations within companies that are doing business. Because people have kind of this unique special relationship with their heart and the cash. You know, they might, people might tolerate if such results are at a lot of date or if some social media site is not 100% caught up. Usually people just don't know this. You know, people notice really quickly and get really upset if something happens with their money or it's a misunderstanding. So, you know, it's a little bit, in many cases it is possible to iterate on our product and gradually weed out all the problems by, you know, gradually exposing its to them. And you know, it's something that we often do. But with payments it's a little bit more difficult. And that space is exactly where the anchors, you know, meet the hipsters where the payment requirements collide with the Ruby and Rails way. So let's start by talking about audit trails. Audit trails is, you know, one of the most basic things, any organization that's dealing with payments needs to orient. And you know, it's a very easy concept for every change in, let's say, business balance, you have to keep track of who made that change, why they made it, and on behalf of whom. Could be the user interacting with the site. It could be a bank returning or completing a transaction to the user's question. It could be a customer service agent on the phone with the user. Those are all the general reasons why a user's balance will change, but they all need to be on it.  I think, you know, not exactly. So, I mean, in theory it's not going to work. But think about it.  You have to guarantee that 100% of those changes are audited and that there is no other change that can somehow outweigh. So, you know, maybe the idea of active record callbacks is not that hot, I think. I mean, how can you deal with the potential for really any part of the code to call, you know, some update to all, or who will be entertained, or just turn off the callbacks, whether or not because whatever developer had some issues with it, they needed to learn. So, you know, this is, of course, possible in other languages as well. I mean, Java, SQL stuff, whatever the language you use, there is a way to bypass the protection provided by the language and the framework. But Ruby is special because what's so good about it is also, in this case, it's bad because it has weaker protections about scopes and basically any code can call any code, almost always. And that's great in most cases. But in this case, it actually makes it kind of hard to find and eliminate unnecessary calls or unwanted calls to your call. So, just to reiterate, if you look at what you get if you have active record, you get a lot of stuff just by virtue of declaring a class as an active record base. And, you know, a lot of that stuff is really useful in most of the types. But, I mean, if you have that class or if you think about that class and go back to the transaction, it's possible. And I'm sure people can come up with a few ways that describe, too, of bypassing or monitoring as if they were using active record. So, if they're being a big part of our course, it's important to use database triggers. We basically don't worry about the changes at the active record level. And we let the database do the hard work. The problem is database triggers creates other problems, right? I mean, it's hard to manage, and, otherwise, it has triggers. It's hard to migrate data. It becomes, you know, an operational data. So, we're experimenting with a few applications and solutions where we're trying to see if we can just for the payments related, the payment tables, have a little bit more stringent access model and still allow the rest of the application to use active record and all these benefits. So, I'll just give you a quick snippet here of, you know, one of the things we're experimenting with. Basically, creating this protected access gem that we're going to be using. And it's not exactly a record in the sense that it looks and feels like a little bit like active record. But what it does in Germany is it hides the actual active record model inside the class in a private domain. And that means that anyone outside of this particular class cannot see, well, people have to work harder if they want to see the active record model.  If you don't use active record, you don't use active record, but then you don't have the benefits of active record. And I think what we're trying to achieve here is this middle ground where you can still expose active records methods or you can expose methods that make limitations to the underlying table, but you have to do it explicitly. You have to add another method to your building that access model. And that means, you know, or the negative side, it's more of work, right? You don't just get it for free. But on the positive side, it has to be coded. So someone has to think about it and actually add it. And then after it's coded, it has to be coded. So someone else needs to actually agree that this is a good idea. And, you know, a discussion can be had about the pros and cons and, you know, there's no accidental messy run with any of these tables. So, you know, we sacrifice speed and ease of use, but we get in return a much more explicit way of interacting with our database and we can ensure through protected access that everything is audited as well. So the next thing I wanted to talk about is early prediction errors. And, you know, I'll explain why I have this tiny spare wheel here. Because I think, well, first of all, let me just make sure that you understand what I'm referring to when I'm saying errors. I don't mean the errors that happen when the user interacts with the system. So, you know, if a user is typing a normal critical number, that's not the error I care about for the purposes of this explosion.  It's an error, but, you know, the application needs to deal with it as part of its normal processing. The errors I'm concerned with here are the kind that your application can continue to use. So it's kind of like a flat tire, right? You're driving on the road, there's a flat tire, and you can't move, right? So, you know, you have... you're expecting that, you know, a form within a credit card field and it doesn't contain it. Or you're expecting that the database is going to be in a certain state and it's not in that state, right? There's nothing you can do. It's about someone who messed up at some point and someone needs to fix it. And this is another thing where we're taking a different approach than what might be the standard... you know, the standard approach often done with Rails is we'd like to make sure that there's a flat tire we stop and we call the tow truck, or we call some things, someone can fix it. There's an excellent book, The Pragmatic Programmer. I don't know if anyone of you knows it. It's kind of old, it's from 2009, but it's still very, very good. And this is how they talk, right? Their program is the overlay. And it's very true. So, you know, how does that work? At the edge of the system, every, you know, the start of the process of entry, or... Well, okay. At the edge of the system, when APIs come in, when calls from clients come in, primary validation is what we have. And that causes programs to terminate early if there's an error. Also, when there are a variance in the code, places in the code where you put a comment, this should never happen. So, if you have a comment, replace it with a fail and, you know, race of exception. Because if it should never happen, but it actually has, you know, something is really, really wrong, and you don't want to keep limping along on this tiny, strict tire because, you know, it's going to potentially damage your car.  For the user, it's better to throw a 500, you have a few users who suffer, but at least someone will know that there's a problem and you can fix it. So, you know, parameter validation sounds good in theory, but you know, it can very, very quickly deteriorate into something that you can really, really mess with.  This is like a job, you know, it's terrible. But, you know, we've created a little BSL that makes it unbelievable, this agreement. And, you know, you can define a method and use the BSL, there's a convention of, we use the convention of passing options as a made hash with all parameters and then you can easily assert what's there and what's not there. This also solves other problems. For example, if someone makes a typo and, you know, instead of confirmation code, they miss my confirmation code, this will complain about it too. So, the BSL also validates that stuff that's not expected is not there. And once you have this validate method, you can just write it, you put it somewhere, like at the end of your file or at the beginning of it, whatever, put it somewhere and you know what to look at it. Right, so the main, the means of your work doesn't have to be muddy with validation. So, all right, we'll talk about protecting the database from other changes and keeping an audit trail and parameter validation. But still, all too often, this is at least what I feel like when I deal with production issues. It happens, you know, everywhere I go, it's always like this. And I think it begs the question, you know, what's missing and what else is going wrong? And I think, one of the things that we try to think about when we write code and evaluate code is something called the law of the reader. And I'm not going to go into the details of what each line and your means. I think that the high level is that you should not reach out into things that are not directly accessible to you. So if you are in a particular class and you're trying to do something, let's take an example. If you're in a class that's you try to apply a coupon. Notice that there's coupon.department.try name. And by the way, this is inspired by Avli Green's excellent blog post about this. You should look it up. It's a good post. And I tried to simplify it a little bit here. And maybe the examples are a little contrived, but bear with me I'll try to walk you through it. So the coupon.department is a direct access to coupon. You're just reaching into coupon and saying, okay, we're in the department. But now you're making an assumption. You're saying, oh, I'm not sure coupon has an apartment, but if it does I'm going to go and reach into the need of it. So your code is now dependent on two hops away from this class. And let's assume you're doing that in several places in this particular class of this particular object. Now, what if the coupon were to change how it encodes the department?  What you're trying to do is to access the department name. But now you're actually carrying the department because you're saying, give me the department. And then you're saying, okay, if the department exists give me the name. So a slightly better way of doing this is to have the knowledge of how given a coupon is the the department provided and you can use it to get that. So I just realized that I don't have the name here. I should fix that. But I think the key concept here as follows. It's that instead of dereferencing coupon into the department, you have a method that does that for you and you segregate that moment into the department and you don't have to worry about it and the rest of the code. An even better way would be to have the department be have this code maybe part of coupon. And then you don't have to worry about it here. But that's a seven issue. So I'm going to focus on what you're going to do here. So and I think it's important to not confuse it with just chaining. It doesn't mean just because there's the law of commuter doesn't mean that chaining is bad. The way to differentiate is if you're chaining something that is the same type of object. For example here, it's string, right? You're taking a string, returning a string, doing something to it, it's still a string so this is just convenience. You're just replacing consecutive parameter assignments instead of having a local variable assigning to it again and again. You're just chaining, right? That's okay. You're not making any more assumptions about string. You're not taking a couple of years to how string is. I mean, long chains might be hard to read at the least of the hell if not so they don't contribute to dislocating the rules. I want to talk about another thing and that's testing. I'm not going to go into testing frameworks. This thing is better or worse than another. I just want to propose this idea to you that I think, you know, a lot of people have very different opinions on somethings. It gets into religious words. I'll just focus on the payments in this case. The idea is small is beautiful and when it comes to testing really, really, really trying to have your methods and your classes as small as you can. It's like, again, trying to find a hole in your bicycle. You go step by step. You need to cover the whole thing. And each time you look at one spot until you find a bubble that tells you that the air is leaking. And, you know, if you have large files particularly large models it's really, really hard to test them. And because it's really hard to test them they're often not tested well. So the coverage of the test is insufficient. Which means that you're always thinking about this field of view. You're suspecting that there's a leak somewhere but you're losing it. You're not sure until you realize that there's a flaw. So, you know, being unsure about your tests is really bad. You want to know that your model is tested and it's tested well. And that, you know, if it's 3,000 microns long you can't judge, right? For 3 years. How can you guarantee that there's no off by 1 cent in that entire file? In that one scenario that's an edge case? You can. So, having smaller files especially smaller models is a really important thing in this scenario. And I know that a lot of people object to having anemic models that may have more functionality in models. That may be true in some cases. I'm not saying it's across the board but I mean, what I am saying is that if you want to have a model that's really, really well tested a good starting point is to have it do as little as possible and segregate or move the heavy lifting somewhere else. And one thing we do and it may be for moving the heavy lifting somewhere else is use what we call service objects. Service objects are used to communicate with service inside our infrastructure but also sometimes they're used inside an application to define API so we want to have a clear definition of an API between the pieces of code. Excuse me. But I mean, a service object is, I mean, it's a fancy name all it is is a perform method which you see here at the bottom wrapped with some standard logging and exception handling and it's just it can be called only once and after it's called it has to be thrown away it returns its results in a hash that you can inspect but it's basically a glorifying method but why is it good? Why do we like it? Well, first of all we have this concept of doing the validation so I already talked about the validation framework we have we usually put off the validation code in validation we call it from the initial integration code and we're done we know now inside the perform method that the parameters are what we expect we also often avoid having any real functionality in the perform method it only calls out to other small methods that are defined within the service object and they're all private so we are sure it's only the service object and the perform method is very small and it has a few calls about the methods, that's all so it's really easy if you open up one of those files A, the name is really descriptive because that thing does work it's almost like a method A, the name of the file so it's really easy also if you want to look inside you don't have to bother with the validation and the initialization, you don't care about this you can go straight to the perform and understand what the file is doing so as we have more and more of those it becomes clear that those are much easier to test they're smaller typically and they have well defined dependencies so the initialization you can see here lists up all the dependencies of the service object and that also makes it easier to test if you want to test it, you just need to provide these parameters and that's it and that way we can avoid unnecessary use of for example factory girl or database level access we have dependencies here we can mock them up and that's it another thing we use, and this I think is outside of the specifics of payments, it's a good practice in general, is the ABC complexity filter so ABC complexity is essentially assignment, branch, and collision it does some math with them it measures how many assignments how many branches, how many conditionals it takes the square of them and then square with the final reason so it ends up being the number and bigger the number the more complex your code and the defaults which are pretty good are set at 15, so 15 is considered the card, below 15 is an okay a good method above 15 is too big so let's just again look at a very simple example here's a piece of code and it takes you a second to read through it and understand what it tells and here's another piece of code that does the same thing except it's ABC complexity is much less, it's almost half of the first example so what happened here well the ABC complexity if we go back to the previous example you can see there's a lot of the references here users do references do references for parameters messages last, sent by there's a lot of the references here and there's an if and else so I guess it's also kind of the density compared to this example where we just extract the input which is what we care about we do a quick check to see if we actually need to deal with it and if not we're speech-able and then all that's left is to actually consider looking at this code is much easier to understand what does it's much easier to see the validation of the source, so pretty validation it's checking edge conditions at the beginning and then you're left with the actual work so the ABC complexity doesn't tell you to do this but if your method is too complex by simplifying it you will end up moving towards this direction and of course it's up to each developer and the conventions of whatever organization you're in to decide how exactly to do that and then one other thing I wanted to mention again it's a derivative concept I don't think it's specific to labels but I think it's very, very important is the don't repeat yourself and again this was introduced to the same Bokeh refer to the programming program and those three words single and ambiguous and authoritative are we in the P here so every piece of knowledge be it in code or in data I will argue though this rule doesn't speak single and data should have a single and ambiguous and authoritative representation within your system and I think a way I like to think about it is those labels that you find on the backs of computers and P and G everywhere if you look at the UL label on the left on the left this label is actually your way of going to the computer manufacturer and talking about the mechanical properties of the computer it's constructed and what's the size and thermal requirements it also talks about electrical stuff it talks about the computer being able to protect itself from problems in the network electrical grid two problems of its own there's a lot of stuff if you read the specification it's lots and lots and lots of pages instead of going and saying that every time, being this of every time you go and check is there a UL local and if there is you know that this authoritative single and ambiguous definition in this background is actually implemented in this problem of course this is a metaphor for a different world but if we go back to the example we had from earlier this is an example of true because there's one place where we actually extract the department from a coupon and we will longer care about it outside of this method the knowledge is in here and that's it if we ever change it we change this method and the rest of the code we need to care about so a few parting thoughts as I've indicated earlier I don't think all of the stuff that I've presented here is relevant for all of the kinds of applications you can collaborate but it definitely is in my opinion important for opinions because of the unique environments of pages and I'd like to also finish with a meta quote I think metaphors and maybe like my world like my metaphoric world it's all tires but metaphors are in general really really important when we think about software because the world actually has gone through the design of systems before the computers and people have thought through those things and have created solutions that are very useful as metaphors and we can use them and if we find the right metaphor we can sometimes make our lives a lot easier in how we design our code and how we learn from other people's mistakes even if they are in a different line of work even if they don't write code even if their decision was made hundreds of years ago so with that if there's any questions then I have to take them I noticed that near the beginning when you inserted protected class for active method active record inside of your class do you use a lot called in-circle only? so you're trying to keep an atomic database inside your database are you using just a regular database where do you use a special atomic database? so that's a good catch only is another gem that we're using which is very very basic it basically uses active records existing mechanisms to declare that active record model is in the room so once you can only knew it and once you save it you cannot make any changes and that's very useful when we're talking about audit trails because even though an object might be new for example if you have a transaction a transaction might transition from pending to success or failure or the amount might change because of itself so the object itself might be new but the role in the database is new so every time you create a new or if you mutate the object in this case in particular case it's a new case we actually create a new role in the database so we're using MySQL at the moment we have no concrete plans to move away from it for payment but what we are experimenting with is different ways of keeping the audit trail and the history of the patients so the way I just described where every time there's information on the object it's a little bit difficult it has problems so we're also experimenting with having an archive table basically a site table so if you have transactions you have transactions archived and mutations and transactions actually happen but every time there's a mutation a role gets written to the archive so that in that case and that makes it easy to use active records straight out of the box just a quick follow up what a lot of people follow you from creating a basic payment system what kinds of models do you use that kind of that kind of audit trail like your orders or just your payment transactions so that's a very good question I think the high level I have a high level answer to this would be as little as possible so I mean messing with audit trails and all this history stuff is complicated and it's painful and generally people hate it it's so convenient to use rails and this just makes it not convenient so we try to use it as little as possible but so if you look at some of the stuff that we're doing transactions are beautiful, it's not only audited but balances for example are not because balances can be computed from transactions so there's no need to make them audited and all that stuff because it actually will create problems if you have two things recording the same data now we have a sync problem and they will always happen so it's better to not choose the one that is the source of the data, in this case transactions and the balances are almost considered like a cache if you wanted to if you really wanted to you cannot have balances and every time you can do a sum of all the transactions of course that's not performed but conceptually speaking balances are you can create different transactions so the high level is as little as possible only the things that you do and I always think about the auditors and auditors come in what are they going to be looking at what are the questions that they're going to be asking and if it involves some of those tables then we lock them down yes so to be perfectly honest we are currently evaluating some of those gyms as I said we're still experimenting with this this is all stuff that we started doing for the month's sake I don't know enough to answer this in a more detailed way but I think it's important to understand that this is in a more detailed way but what I will say is that what we mean is something that generates C and generates data structures that are accessible by C I think some of those gyms audit trail, there's another one I forget its name use different mechanisms to keep history of the data which might be I know it started for us because there are downstream consumers of that data and they rely on the data internally to be accessible to use I'll just mention since we're talking about alternatives we are also actively exploring using non-sequel mechanisms to propagate changes so instead of writing a row into a paragraph table and relying on that for guidance from changes we might use the system like Kafka to propagate basically Kafka is a reliable, resilient deliver deliver at least once guaranteed system so it's like a message key but very robust in the city instead of writing a row to a database we might publish a row to Kafka and then have a consumer on the other end write a row to a consumer database so we're experimenting with that as well yes Do you have some kind of technical excavation process for things that come in from customers that are involved? That's a very good question but I think it's a generic system it's not specific to payments but in general we have all the standard mechanisms so basically if code throws an exception in production it gets collected and it's visible to us in the backend we have all kinds of metrics in order so I think as code will happen we get alerted to if there's a new kind of exception that started to be thrown or an exception that's been thrown consistently someone will go take a look at it and have a look at it I don't know if that answers your question If I can keep on going a little bit I'm thinking specifically of something like a say that even a customer is really in a state of payment processors not any games so for whatever reason that got passed it'll keep you in control so how strict are you about that? I think this is a little bit outside of the area where you are operating there is a customer service operation actually a pretty large one and within it there's a small group that is focused on on the payments so those people typically end up dealing with customers that have questions or issues with the payments I think generally speaking the philosophy of Airbnb and I'm not that this is not the payment specific generally speaking the philosophy of Airbnb the whole travel experience for users as pleasurable as possible and we try very hard to assume that our users are well-leaning and if they call then there's a real problem and deal their side it still that doesn't mean how that doesn't mean that we solve disputes there's a group of people right? Thanks a lot