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.
Once a week.
Subscribe to our weekly newsletter.
Research reveals a new evolutionary feature that separates humans from other primates.
- Researchers find a new feature of human evolution.
- Humans have evolved to use less water per day than other primates.
- The nose is one of the factors that allows humans to be water efficient.
A model of water turnover for humans and chimpanzees who have similar fat free mass and body water pools.
Credit: Current Biology
Being skeptical isn't just about being contrarian. It's about asking the right questions of ourselves and others to gain understanding.
- It's not always easy to tell the difference between objective truth and what we believe to be true. Separating facts from opinions, according to skeptic Michael Shermer, theoretical physicist Lawrence Krauss, and others, requires research, self-reflection, and time.
- Recognizing your own biases and those of others, avoiding echo chambers, actively seeking out opposing voices, and asking smart, testable questions are a few of the ways that skepticism can be a useful tool for learning and growth.
- As Derren Brown points out, being "skeptical of skepticism" can also lead to interesting revelations and teach us new things about ourselves and our psychology.
A man's skeleton, found facedown with his hands bound, was unearthed near an ancient ceremonial circle during a high speed rail excavation project.
- A skeleton representing a man who was tossed face down into a ditch nearly 2,500 years ago with his hands bound in front of his hips was dug up during an excavation outside of London.
- The discovery was made during a high speed rail project that has been a bonanza for archaeology, as the area is home to more than 60 ancient sites along the planned route.
- An ornate grave of a high status individual from the Roman period and an ancient ceremonial circle were also discovered during the excavations.
Foul play?<p>A skeleton representing a man who was tossed face down into a ditch nearly 2,500 years ago with his hands bound in front of his hips was dug up during a high speed rail excavation.</p><p>The positioning of the remains have led archaeologists to suspect that the man may have been a victim of an ancient murder or execution. Though any bindings have since decomposed, his hands were positioned together and pinned under his pelvis. There was also no sign of a grave or coffin. </p><p>"He seems to have had his hands tied, and he was face-down in the bottom of the ditch," <a href="https://www.livescience.com/iron-age-murder-victim-england.html" target="_blank">said archaeologist Rachel Wood</a>, who led the excavation. "There are not many ways that you end up that way."</p><p>Currently, archaeologists are examining the skeleton to uncover more information about the circumstances of the man's death. Fragments of pottery found in the ditch may offer some clues as to exactly when the man died. </p><p>"If he was struck across the head with a heavy object, you could find a mark of that on the back of the skull," Wood said to <a href="https://www.livescience.com/iron-age-murder-victim-england.html" target="_blank">Live Science</a>. "If he was stabbed, you could find blade marks on the ribs. So we're hoping to find something like that, to tell us how he died."</p>
Other discoveries at Wellwick Farm<p>The grim discovery was made at Wellwick Farm near Wendover. That is about 15 miles north-west of the outskirts of London, where <a href="https://www.hs2.org.uk/building-hs2/hs2-green-corridor/" target="_blank">a tunnel</a> is going to be built as part of a HS2 high-speed rail project due to open between London and several northern cities sometime after 2028. The infrastructure project has been something of a bonanza for archaeology as the area is home to more than 60 ancient sites along the planned route that are now being excavated before construction begins. </p><p>The farm sits less than a mile away from the ancient highway <a href="http://web.stanford.edu/group/texttechnologies/cgi-bin/stanfordnottingham/places/?icknield" target="_blank">Icknield Way</a> that runs along the tops of the Chiltern Hills. The route (now mostly trails) has been used since prehistoric times. Evidence at Wellwick Farm indicates that from the Neolithic to the Medieval eras, humans have occupied the region for more than 4,000 years, making it a rich area for archaeological finds. </p><p>Wood and her colleagues found some evidence of an ancient village occupied from the late Bronze Age (more than 3,000 years ago) until the Roman Empire's invasion of southern England about 2,000 years ago. At the site were the remains of animal pens, pits for disposing food, and a roundhouse — a standard British dwelling during the Bronze Age constructed with a circular plan made of stone or wood topped with a conical thatched roof.</p>
Ceremonial burial site<img type="lazy-image" data-runner-src="https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8yMzUzMTk0Ni9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTY0NDgwNTIyMX0.I49n1-j8WVhKjIZS_wVWZissnk3W1583yYXB7qaGtN8/img.jpg?width=1245&coordinates=0%2C82%2C0%2C83&height=700" id="44da7" class="rm-shortcode" data-rm-shortcode-id="46cfc8ca1c64fc404b32014542221275" data-rm-shortcode-name="rebelmouse-image" alt="top down view of coffin" data-width="1245" data-height="700" />
A high status burial in a lead-lined coffin dating back to Roman times.
Photo Credit: HS2<p>While these ancient people moved away from Wellwick Farm before the Romans invaded, a large portion of the area was still used for ritual burials for high-status members of society, Wood told Live Science. The ceremonial burial site included a circular ditch (about 60 feet across) at the center, and was a bit of a distance away from the ditch where the (suspected) murder victim was uncovered. Additionally, archaeologists found an ornately detailed grave near the sacred burial site that dates back to the Roman period, hundreds of years later when the original Bronze Age burial site would have been overgrown.</p><p>The newer grave from the Roman period encapsulated an adult skeleton contained in a lead-lined coffin. It's likely that the outer coffin had been made of wood that rotted away. Since it was clearly an ornate burial, the occupant of the grave was probably a person of high status who could afford such a lavish burial. However, according to Wood, no treasures or tokens had been discovered. </p>
Sacred timber circle<img type="lazy-image" data-runner-src="https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8yMzUzMTk0Ny9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTY2MDAwOTQ4Mn0.eVJAUcD0uBUkVMFuMOPSgH8EssGkfLf_MjwUv0zGCI8/img.jpg?width=1245&coordinates=0%2C149%2C0%2C149&height=700" id="9de6a" class="rm-shortcode" data-rm-shortcode-id="ee66520d470b26f5c055eaef0b95ec06" data-rm-shortcode-name="rebelmouse-image" alt="An aerial view of the sacred circular monument." data-width="1245" data-height="700" />
An aerial view of the sacred circular monument.
Photo Credit: HS2<p>One of the most compelling archaeological discoveries at Wellwick Farm are the indications of a huge ceremonial circle once circumscribed by timber posts lying south of the Bronze Age burial site. Though the wooden posts have rotted away, signs of the post holes remain. It's thought to date from the Neolithic period to 5,000 years ago, according to Wood.</p><p>This circle would have had a diameter stretching 210 feet across and consisted of two rings of hundreds of posts. There would have been an entry gap to the south-west. Five posts in the very center of the circle aligned with that same gap, which, according to Wood, appeared to have been in the direction of the rising sun on the day of the midwinter solstice. </p><p>Similar Neolithic timber circles have been discovered around Great Britain, such as one near <a href="https://bigthink.com/culture-religion/stonehenge-sarsens" target="_blank">Stonehenge</a> that is considered to date back to around the same time. </p>
New study suggests the placebo effect can be as powerful as microdosing LSD.
- New research from Imperial College London investigated the psychological effects of microdosing LSD in 191 volunteers.
- While microdosers experienced beneficial mental health effects, the placebo group performed statistically similar to those who took LSD.
- Researchers believe the expectation of a trip could produce some of the same sensations as actually ingesting psychedelics.
Psychedelics: The scientific renaissance of mind-altering drugs<span style="display:block;position:relative;padding-top:56.25%;" class="rm-shortcode" data-rm-shortcode-id="92360c805fe66c11de38a75b0967f417"><iframe type="lazy-iframe" data-runner-src="https://www.youtube.com/embed/5T0LmbWROKY?rel=0" width="100%" height="auto" frameborder="0" scrolling="no" style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe></span><p>For the study published in eLife, the team recruited 191 citizen cosmonauts to microdose either LSD or a placebo over the course of several weeks and note the psychological effects. Volunteers were already microdosing LSD, so there was no true control. Each volunteer was given instructions on creating their own low-dose gel capsules, some containing LSD, others not. Then they mixed the capsules in envelopes so they didn't know if they were taking the real thing or not.</p><p>The trial design was ingenious: each capsule featured a QR code that was scanned after the addition of ingredients but before they were placed in the envelope so that researchers knew what they were ingesting.</p><p>The problem: volunteers sourced their own LSD. Lack of quality control could have had a profound effect on the results. </p><p>The results: LSD microdosers reported feeling more mindful, satisfied with life, and better overall; they also noticed a reduction in feelings of paranoia. </p><p>The catch: the control group felt the same thing, with no statistical difference between the groups. </p><p>Lead author Balázs Szigeti comments on the findings: "This suggests that the improvements may not be due to the pharmacological action of the drug but can instead be explained by the placebo effect." </p>
Credit: Alexander / Adobe Stock<p>Psychedelics are notoriously difficult to control for given the intensity of the experience. Yet there is precedent for the above findings. A <a href="https://link.springer.com/article/10.1007/s00213-020-05464-5" target="_blank">2019 study</a> found that 61 percent of volunteers that took a placebo instead of psilocybin felt some psychedelic effects, with a few volunteers experiencing full-on trips.</p><p style="margin-left: 20px;">"Several stated that they saw the paintings on the walls 'move' or 'reshape' themselves, others felt 'heavy. . . as if gravity [had] a stronger hold', and one had a 'come down' before another 'wave' hit her."</p><p>The Imperial team believes the expectation of a trip might have been enough to produce similar results. Senior author David Erritzoe is excited for future studies on the topic, believing they tapped into a new wave of citizen science that could push forward our knowledge of psychedelic substances.</p><p style="margin-left: 20px;">"Accounting for the placebo effect is important when assessing trends such as the use of cannabidiol oils, fad diets or supplements where social pressure or users' expectations can lead to a strong placebo response. Self-blinding citizen science initiatives could be used as an inexpensive, initial screening tool before launching expensive clinical studies."</p><p>As investments into the psychedelics market explode, with one company <a href="https://www.bloomberg.com/news/articles/2021-03-03/thiel-backed-magic-mushroom-firm-atai-hits-2-billion-valuation" target="_blank">reaching a $2 billion valuation</a>, a recurring irony appears in the long arc of psychedelics and research: the power of our minds might be enough to feel greater life satisfaction and a deeper sense of mindfulness. If that's possible with a placebo, we have to question why the rush to create more pharmacology is necessary. </p><p>This is, mind you, a separate conversation over the role of psychedelics and rituals for group bonding. The function of group cohesion around consciousness-altering substances will continue to play an important role in many communities. </p><p>Of course, we should continue to explore the efficacy of psychedelics on anxiety, depression, suicidal ideation, PTSD, and addiction. <a href="https://bigthink.com/surprising-science/antidepressant-effects" target="_self">Pharmacological dependence</a> is a stain on the psychiatry industry. Whether or not psychedelics can be prescribed for daily use remains to be seen, but we know a moneyed interest is expecting a return on investment—the above company, ATAI Life Sciences, raised $157 million in its Series D round. </p><p>When it comes to wellbeing, some things money just can't buy. How we navigate the tricky terrain of mainstreaming psychedelics remains to be seen. </p><p>--</p><p><em>Stay in touch with Derek on <a href="http://www.twitter.com/derekberes" target="_blank">Twitter</a> and <a href="https://www.facebook.com/DerekBeresdotcom" target="_blank" rel="noopener noreferrer">Facebook</a>. His most recent book is</em> "<em><a href="https://www.amazon.com/gp/product/B08KRVMP2M?pf_rd_r=MDJW43337675SZ0X00FH&pf_rd_p=edaba0ee-c2fe-4124-9f5d-b31d6b1bfbee" target="_blank" rel="noopener noreferrer">Hero's Dose: The Case For Psychedelics in Ritual and Therapy</a>."</em></p>