from the world's big
Good Programming Is Like Good Writing
David Heinemeier Hansson is a Danish programmer and the creator of the Ruby on Rails open source web development framework. He is also a partner with Jason Fried at the web-based software development firm 37signals. In 2005 he was given with the Hacker of the Year by Google and O'Reilly award for his creation of Ruby on Rails. He and Fried have also co-authored the New York Times bestseller "Rework," which reveals their secrets for boosting business productivity in the Internet age.
Question: What makes Ruby a special language?
David Heinemeier Hansson: To me good programming is just like good writing. It's succinct. You're expressing what you want to say in as few words as possible. You're picking just the right words for the sentence, and it's sort of a grand thing. A program is just like an article or a book; it's composed of tiny things like words that form into sentences, and paragraphs, and chapters, and so forth. A programming language—a good programming language—allows you to build a program in just the same way.
So you'll have methods that are really short. A big part of what makes Ruby so special to work with is just how much expression you can pack into few lines of code. When I compare it to something like Java where it takes perhaps ten lines to express a very simple operation, that same operation can be expressed in a single line of Ruby. And that just makes understanding the entire program that much easier when the density of expression is so much higher, and it's not just because it's short. There's plenty of programming languages where you can write exceptionally short code, and it's completely unreadable afterward. Ruby has this uncanny ability to just be shortened the same way your thought would be short, but no shorter than that.
The other part of it is also having a grand or free mode of expression that there are many different ways that you can say something. So for example: Lots of programming languages have—or all program languages have—conditionals. If something is true, do this. Now, sometimes you want the positive version of that. Like, “If employee works here, then print this screen.” Sometimes you want the opposite. In most program languages, you would go about that by saying, “If not programmer works here, then do this.” That's not a very natural way of expressing that. You would never say that in real life.
In Ruby, you can say, “Unless the programmer works here, do this.” So it's just all those little things where the creator of Ruby thought about the whole picture. It's not just that you can get something done. All programming languages can do the same things. There's nothing you can do in Ruby that you couldn't do in some other programming language. What makes Ruby special is how you say it.
Compared to natural languages, I think there's also just something to the tone and they rhythm of it. I'm Danish. I speak Danish, and I admit that Danish is not a very pretty language. Thankfully, it's not as ugly as German, which I think is probably one of the ugliest languages of all time. But if you compare something like German to something like French, you don't have to speak either language to hear that French is obviously the prettier language.
I think if somebody who doesn't even know code, they can look at a piece of Ruby code, and they can appreciate that Ruby is French and Java is German. That's sort of really the appeal to it. Because you have to work with this stuff all the time. Programmers often work for many, many, many hours a day, and this is your main mode of expression. It has to be good. If it's not good, if you're speaking in an ugly language every day for eight or ten hours a day... well, I won't say that it turns you into an ugly person, but I like to just surround myself with beautiful things. Ruby is beautiful; lots of other programming languages are much less so.
Question: Do programmers need to like the languages in which they code?
David Heinemeier Hansson: I think in the past, programming languages and environments have been determined by everything but the beauty of expression. It's been determined by “We have to make this really fast. We have to make this really efficient. We have to make this really logical. There has to be only one way of doing things.” All of these other concerns that you would think about when you would think about somebody approaching it in a very sort of binary approach. That's sort of the best way I can express it.
Ruby comes from a much different angle. In fact, the creator of Ruby said that his main goal of creating Ruby was to make programmers happy. Now, you're introducing something that in many ways seems like a foreign concept. You're talking about code. What does happiness have to do with anything? How does happiness play into this stuff? It absolutely does because programmers—surprisingly enough, I'm sure to a lot of people—are humans, too. And humans just respond to emotional things. They respond to beauty, they respond to a general sense of well being and liking your tools. It's not enough that your tools can get the job done. It's how they get them done. It's whether you like wielding those tools day out and day in.
And I've talked to a lot of Ruby programmers who came to sort of the edge of their career thinking they've been working in Java, or C-Sharp, or some other language that was just driving them miserable. And they were thinking, “You know what? I know how to do this stuff, but it's probably not for me. I'm not happy working with these languages or environments every day. I'm going to quit.” And then some of them found Ruby. And it almost sounds cheesy as sort of a religious experience that they find this program language that all of a sudden makes it interesting for them again to be programmers. But it's absolutely true. I felt exactly the same way. I was absolutely not convinced that I was going to be a programmer when I was working with PHP and Java.
To me, at that point programming was just something I had to do to get programs. It was sort of just a functional thing I unfortunately had to go through in order to realize the ideas that I had for programs. For me, Ruby just changed that such that the act itself was pleasurable. And I think that's just a magic moment. When you change over from not just being able to do the job to actually enjoying the job. That's just a huge difference. And I think that the product in the end also reflects that. The programs I write now are much better than the programs I wrote when I didn't like my tools.
Recorded on July 22, 2010
Interviewed by Peter Hopkins
"A big part of what makes Ruby so special to work with is just how much expression you can pack into a few lines of code," says Hansson.
Join multiple Tony and Emmy Award-winning actress Judith Light live on Big Think at 2 pm ET on Monday.
Frequent shopping for single items adds to our carbon footprint.
- A new study shows e-commerce sites like Amazon leave larger greenhouse gas footprints than retail stores.
- Ordering online from retail stores has an even smaller footprint than going to the store yourself.
- Greening efforts by major e-commerce sites won't curb wasteful consumer habits. Consolidating online orders can make a difference.
A pile of recycled cardboard sits on the ground at Recology's Recycle Central on January 4, 2018 in San Francisco, California.
Photo by Justin Sullivan/Getty Images<p>A large part of the reason is speed. In a competitive market, pure players use the equation, <em>speed + convenience</em>, to drive adoption. This is especially relevant to the "last mile" GHG footprint: the distance between the distribution center and the consumer.</p><p>Interestingly, the smallest GHG footprint occurs when you order directly from a physical store—even smaller than going there yourself. Pure players, such as Amazon, are the greatest offenders. Variables like geographic location matter; the team looked at shopping in the UK, the US, China, and the Netherlands. </p><p>Sadegh Shahmohammadi, a PhD student at the Netherlands' Radboud University and corresponding author of the paper, <a href="https://www.cnn.com/2020/02/26/tech/greenhouse-gas-emissions-retail/index.html" target="_blank">says</a> the above "pattern holds true in countries where people mostly drive. It really depends on the country and consumer behavior there."</p><p>The researchers write that this year-and-a-half long study pushes back on previous research that claims online shopping to be better in terms of GHG footprints.</p><p style="margin-left: 20px;">"They have, however, compared the GHG emissions per shopping event and did not consider the link between the retail channels and the basket size, which leads to a different conclusion than that of the current study."</p><p>Online retail is where convenience trumps environment: people tend to order one item at a time when shopping on pure player sites, whereas they stock up on multiple items when visiting a store. Consumers will sometimes order a number of separate items over the course of a week rather than making one trip to purchase everything they need. </p><p>While greening efforts by online retailers are important, until a shift in consumer attitude changes, the current carbon footprint will be a hard obstacle to overcome. Amazon is trying to have it both ways—carbon-free and convenience addicted—and the math isn't adding up. If you need to order things, do it online, but try to consolidate your purchases as much as possible.</p><p>--</p><p><em>Stay in touch with Derek on <a href="http://www.twitter.com/derekberes" target="_blank">Twitter</a>, <a href="https://www.facebook.com/DerekBeresdotcom" target="_blank">Facebook</a> and <a href="https://derekberes.substack.com/" target="_blank">Substack</a>. His next book is</em> "<em>Hero's Dose: The Case For Psychedelics in Ritual and Therapy."</em></p>
Chronic irregular sleep in children was associated with psychotic experiences in adolescence, according to a recent study out of the University of Birmingham's School of Psychology.
A time for sleep<div class="rm-shortcode" data-media_id="Mt29uUqI" data-player_id="FvQKszTI" data-rm-shortcode-id="931343dee3c02121445e51e94ba22446"> <div id="botr_Mt29uUqI_FvQKszTI_div" class="jwplayer-media" data-jwplayer-video-src="https://content.jwplatform.com/players/Mt29uUqI-FvQKszTI.js"> <img src="https://cdn.jwplayer.com/thumbs/Mt29uUqI-1920.jpg" class="jwplayer-media-preview" /> </div> <script src="https://content.jwplatform.com/players/Mt29uUqI-FvQKszTI.js"></script> </div> <p>Previous studies had already suggested a link between persistent nightmares in childhood and psychosis and borderline personality disorder (BPD) by adolescence, but researchers at the University of Birmingham's School of Psychology wanted to see if a similar connection existed between these mental disorders and other childhood behavioral sleep problems.</p><p>To do this, they scoured data from the Avon Longitudinal Study of Parents and Children, a longitudinal cohort study that followed approximately 14,000 children born in Avon, England, in the early 1990s. The study followed the children for more than 13 years. During that time, mothers filled out questionnaires asking about the children's lives. Factors looked at included housing, parenting, nutrition, physical health, mental wellbeing, environmental exposures, and so on. </p><p>The cohort study inquired about sleep routines, sleep duration, and awakening frequency when the children were 6, 18, and 30 months old, and then again at 3.5, 4.8, and 5.8 years. It also assessed mental health in adolescence using semi-structured interviews, such as the Psychosis-Like Symptom Interview.</p><p>"We know that adolescence is a key developmental period to study the onset of many mental disorders, including psychosis or BPD. This is because of particular brain and hormonal changes which occur at this stage," <a href="https://www.birmingham.ac.uk/staff/profiles/psychology/marwaha-steven.aspx" target="_blank">Steven Marwaha</a>, professor of psychiatry at Birmingham and senior author on the study, <a href="https://www.sciencedaily.com/releases/2020/07/200701125431.htm" target="_blank">said in a release</a>. "Sleep may be one of the most important underlying factors—and it's one that we can influence with effective, early interventions, so it's important that we understand these links."</p><p>After compiling the data, the researchers discovered an association between children with irregular sleeping patterns and teenagers with <a href="https://www.mind.org.uk/information-support/types-of-mental-health-problems/psychosis/about-psychosis/" target="_blank">psychotic experiences</a>—that is, episodes when the person perceives reality differently than those around them. Even when depression at 10 years old was considered as a mediating factor, their findings still suggested "a specific pathway between these childhood sleep problems and adolescent psychotic experiences." </p><p>Toddlers with shorter nighttime sleep duration and late bedtimes were likewise associated with a <a href="https://www.nimh.nih.gov/health/topics/borderline-personality-disorder/index.shtml" target="_blank">borderline personality disorder</a>—a disorder marked by a pattern of varying moods, self-images, and behaviors—in their teenage years. Depression at age 10 did not mediate this particular association, suggesting a separate and more specific pathway. </p>
A more restful tomorrow<p>While the sample size was large and mental health was assessed with a validated interview, there nevertheless remain limitations to this data. For starters, sleep habits were based on mothers' reports. Because they came from memory, versus a more direct observation method such as actigraphy, these data may be prone to imperfect recollection and reporting error. There are also many confounders that could be secretly nudging the results, such as family conditions, prenatal medicines, and a host of environmental factors. Finally, <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6024884/#:~:text=Sleep%20difficulties%20in%20youth%20with,fear%20of%20dark%20%5B13%5D." target="_blank">the relationship between sleep problems and mental disorders</a> is both complex and two-way.</p><p>As such, the study shows an association between poor childhood sleep later mental disorders but does not prove a causal link. Parents need not worry that a string of nightmares or the eternal struggle settle into bed will be the first ingredients in a witches' brew of debilitating mental disorders. The goal of the study, the researchers point out, is not to create undue worry but improve our ability to recognize the signs of at-risk children and deliver necessary interventions earlier.</p><p>"The results of this study could have important implications for helping practitioners identify children who might be at higher risk for psychotic experiences or BPD symptoms in adolescence, and potentially lead to the design of more effectively targeted sleep or psychological interventions to prevent the onset or attenuate these mental disorders," Isabel Morales-Muñoz, the study's lead researcher, <a href="https://www.healio.com/news/psychiatry/20200702/childhood-sleep-problems-linked-to-adolescent-psychosis-borderline-personality-disorder#:~:text=Sleep%20problems%20during%20early%20childhood,study%20published%20in%20JAMA%20Psychiatry." target="_blank">told Healio Psychiatry</a><u>.</u></p><p>If a parent reading this is worried that their child's sleep patterns are deleterious, the take away should not be despair over an unyielding fate. It should be to seek professional help as soon as possible to begin improving sleep duration and quality. Even if you aren't worried, it's worth remembering that childhood experiences lay the foundation for a lifetime of salubrious sleeping habits. It's so much more than beauty rest.</p>
Construction of the $500 billion dollar tech city-state of the future is moving ahead.
- The futuristic megacity Neom is being built in Saudi Arabia.
- The city will be fully automated, leading in health, education and quality of life.
- It will feature an artificial moon, cloud seeding, robotic gladiators and flying taxis.
The Red Sea area where Neom will be built:
Saudi Arabia Plans Futuristic City, "Neom" (Full Promotional Video)<span style="display:block;position:relative;padding-top:56.25%;" class="rm-shortcode" data-rm-shortcode-id="c646d528d230c1bf66c75422bc4ccf6f"><iframe type="lazy-iframe" data-runner-src="https://www.youtube.com/embed/N53DzL3_BHA?rel=0" width="100%" height="auto" frameborder="0" scrolling="no" style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe></span>
Are we genetically inclined for superstition or just fearful of the truth?
- From secret societies to faked moon landings, one thing that humanity seems to have an endless supply of is conspiracy theories. In this compilation, physicist Michio Kaku, science communicator Bill Nye, psychologist Sarah Rose Cavanagh, skeptic Michael Shermer, and actor and playwright John Cameron Mitchell consider the nature of truth and why some groups believe the things they do.
- "I think there's a gene for superstition, a gene for hearsay, a gene for magic, a gene for magical thinking," argues Kaku. The theoretical physicist says that science goes against "natural thinking," and that the superstition gene persists because, one out of ten times, it actually worked and saved us.
- Other theories shared include the idea of cognitive dissonance, the dangerous power of fear to inhibit critical thinking, and Hollywood's romanticization of conspiracies. Because conspiracy theories are so diverse and multifaceted, combating them has not been an easy task for science.