---
title: "Meaning & Key Takeaway of: To write code this way, you need to…"
description: "\"“To write code this way, you need to consider the events that can happen, and how your code should react. Computer science types like to say that this ..."
image: "https://sms4smile.com/quotes/i/54d/eric-freeman-7573_computer-science_to-write-code-this-way-you-need-to-consi_2137327.jpg"
---

#  To write code this way, you need to consider the events…

![“To write code this way, you need to consider the events that can happen, and how your code should react. Computer science types like to say that this kind of code is asynchronous, because we’re writing code to be invoked later, if and when an event occurs. This” quote by Eric Freeman](https://sms4smile.com/quotes/i/54d/eric-freeman-7573_computer-science_to-write-code-this-way-you-need-to-consi_2137327.jpg)   [Download](https://sms4smile.com/quotes/i/54d/eric-freeman-7573_computer-science_to-write-code-this-way-you-need-to-consi_2137327.jpg) [Open image](https://sms4smile.com/quotes/i/54d/eric-freeman-7573_computer-science_to-write-code-this-way-you-need-to-consi_2137327.jpg)

> ““To write code this way, you need to consider the events that can happen, and how your code should react. Computer science types like to say that this kind of code is asynchronous, because we’re writing code to be invoked later, if and when an event occurs. This””

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

## About This Quote

This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.

Effective code must anticipate possible events and define appropriate reactions, embodying asynchronous programming principles.

**In simple terms:** Plan for events and reactions in code.

Key Takeaway

Design systems that handle future events gracefully.

Themes

software design asynchrony robustness

Mood

analytical practical

Type

technical educational

When to use this quote

- Building responsive UI
- network request handling
- real-time data processing

Key Concepts

event-driven architecture reactive programming error handling

Questions to Reflect On

- How do you test asynchronous code?
- What patterns help manage event complexity?

A Different Perspective

Complexity can increase debugging difficulty.

★ ★ ★ ★ ★   No ratings yet

[Computer science](https://sms4smile.com/quotes/about/computer-science/) [Programming](https://sms4smile.com/quotes/about/programming/) [Science](https://sms4smile.com/quotes/about/science/) [Technology](https://sms4smile.com/quotes/about/technology/) [Writing code](https://sms4smile.com/quotes/about/writing-code/)

## Related quotes

> [Many days I don't write any code at all, and some days I spend all day writing code.](https://sms4smile.com/quotes/larry-wall/many-days-i-don-t-write-any-code-at-all-and-some-days-i-spend-all-day/)

[Larry Wall](https://sms4smile.com/quotes/author/larry-wall/)

> [Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you…](https://sms4smile.com/quotes/brian-kernighan/debugging-is-twice-as-hard-as-writing-the-code-in-the-first-place/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [“We haven’t done much writing code, but we are reading and understanding code, and that can be just as good. So”](https://sms4smile.com/quotes/eric-freeman/we-haven-t-done-much-writing-code-but-we-are-reading-and/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“When Hiro learned how to do this, way back fifteen years ago, a hacker could sit down and write an entire piece of software…](https://sms4smile.com/quotes/neal-stephenson/when-hiro-learned-how-to-do-this-way-back-fifteen-years-ago-a-hacker/)

[Neal Stephenson](https://sms4smile.com/quotes/author/neal-stephenson/)

> [“The only rule remains: write less code.”](https://sms4smile.com/quotes/anonymous/the-only-rule-remains-write-less-code/)

[Anonymous](https://sms4smile.com/quotes/author/anonymous/)

> [We all rely on technology to communicate, to survive, to do our banking, to shop, to get informed, but none of us knows how…](https://sms4smile.com/quotes/will-i-am/we-all-rely-on-technology-to-communicate-to-survive-to-do-our-banking/)

[will.i.am](https://sms4smile.com/quotes/author/will-i-am/)

> [“I write in code.”](https://sms4smile.com/quotes/abigail-george/i-write-in-code/)

[Abigail George](https://sms4smile.com/quotes/author/abigail-george/)

> [I'm kind of a retired software engineer. I don't write code anymore.](https://sms4smile.com/quotes/paul-allen/i-m-kind-of-a-retired-software-engineer-i-don-t-write-code-anymore/)

[Paul Allen](https://sms4smile.com/quotes/author/paul-allen/)

> [Real web designers write code. Always have, always will.](https://sms4smile.com/quotes/jeffrey-zeldman/real-web-designers-write-code-always-have-always-will/)

[Jeffrey Zeldman](https://sms4smile.com/quotes/author/jeffrey-zeldman/)

> [Everybody in Hollywood has to beat the 'no' - and if you write code in Silicon Valley, or if you design cars in Detroit,…](https://sms4smile.com/quotes/brian-grazer/everybody-in-hollywood-has-to-beat-the-no-and-if-you-write-code-in/)

[Brian Grazer](https://sms4smile.com/quotes/author/brian-grazer/)

> [As technologists, we all write code.](https://sms4smile.com/quotes/naveen-tewari/as-technologists-we-all-write-code/)

[Naveen Tewari](https://sms4smile.com/quotes/author/naveen-tewari/)

> [Any fool can write code that a computer can understand. Good programmers write code that humans can understand.](https://sms4smile.com/quotes/martin-fowler/any-fool-can-write-code-that-a-computer-can-understand-good/)

[Martin Fowler](https://sms4smile.com/quotes/author/martin-fowler/)

> [Writing code is not production, it's not always craftsmanship though it can be, it's design.](https://sms4smile.com/quotes/joel-spolsky/writing-code-is-not-production-it-s-not-always-craftsmanship-though/)

[Joel Spolsky](https://sms4smile.com/quotes/author/joel-spolsky/)

> [At forty, I was too old to work as a programmer myself anymore; writing code is a young person’s job.](https://sms4smile.com/quotes/michael-crichton/at-forty-i-was-too-old-to-work-as-a-programmer-myself-anymore-writing/)

[Michael Crichton](https://sms4smile.com/quotes/author/michael-crichton/)

> [Writing code means always having to say you're sorry.](https://sms4smile.com/quotes/paul-ford/writing-code-means-always-having-to-say-you-re-sorry/)

[Paul Ford](https://sms4smile.com/quotes/author/paul-ford/)

## More by Eric Freeman

> [“When you delete a property, you’re not just deleting the value of the property, you’re deleting the property itself. And, if you try to…](https://sms4smile.com/quotes/eric-freeman/when-you-delete-a-property-you-re-not-just-deleting-the-value-of-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“the constructor always has a prototype property. More”](https://sms4smile.com/quotes/eric-freeman/the-constructor-always-has-a-prototype-property-more/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“when you assign a value to a variable name that hasn’t been previously declared, it is treated as a new, global variable. So be…](https://sms4smile.com/quotes/eric-freeman/when-you-assign-a-value-to-a-variable-name-that-hasn-t-been/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Web Workers have a global function named importScripts that you can use to import one or more JavaScript files into your worker. To”](https://sms4smile.com/quotes/eric-freeman/web-workers-have-a-global-function-named-importscripts-that-you-can/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“If the two values have different types, try to convert them into the same type and then compare them”](https://sms4smile.com/quotes/eric-freeman/if-the-two-values-have-different-types-try-to-convert-them-into-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Well, it’s a browser policy, and it says you can’t retrieve data from a domain that is different from the domain the page itself…](https://sms4smile.com/quotes/eric-freeman/well-it-s-a-browser-policy-and-it-says-you-can-t-retrieve-data-from-a/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Math is not a constructor, or even a function. It’s an object. As you know, Math is a built-in object that you can use…](https://sms4smile.com/quotes/eric-freeman/math-is-not-a-constructor-or-even-a-function-it-s-an-object-as-you/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“When you pass zero to setTimeout, you’re asking JavaScript to run your timeout handler as soon as it possibly can — and this leads…](https://sms4smile.com/quotes/eric-freeman/when-you-pass-zero-to-settimeout-you-re-asking-javascript-to-run-your/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“JavaScript doesn’t have a character type. So characters are returned as new strings containing one character.”](https://sms4smile.com/quotes/eric-freeman/javascript-doesn-t-have-a-character-type-so-characters-are-returned/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Closures are often used to capture state for event handlers.”](https://sms4smile.com/quotes/eric-freeman/closures-are-often-used-to-capture-state-for-event-handlers/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Lexical scope means that we can determine the scope of a variable by reading our code.”](https://sms4smile.com/quotes/eric-freeman/lexical-scope-means-that-we-can-determine-the-scope-of-a-variable-by/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“Q: Q: You said getElementsByTagName returns a list. Do you mean an array? A: A: It returns an object that you can treat like…](https://sms4smile.com/quotes/eric-freeman/q-q-you-said-getelementsbytagname-returns-a-list-do-you-mean-an-array/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“the truth is JavaScript actually makes two passes over your page: in the first pass it reads all the function definitions, and in the…](https://sms4smile.com/quotes/eric-freeman/the-truth-is-javascript-actually-makes-two-passes-over-your-page-in/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“If you change any property in the prototype, it affects all the objects that inherit from that prototype, unless that object has overridden that…](https://sms4smile.com/quotes/eric-freeman/if-you-change-any-property-in-the-prototype-it-affects-all-the/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

> [“methods in objects are properties too. They just happen to have a function assigned to them.”](https://sms4smile.com/quotes/eric-freeman/methods-in-objects-are-properties-too-they-just-happen-to-have-a/)

[Eric Freeman](https://sms4smile.com/quotes/author/eric-freeman/)

[Explore all 90 Eric Freeman quotes ](https://sms4smile.com/quotes/author/eric-freeman/)

## More Computer science quotes

> [It's interesting that the greatest minds of computer science, the founding fathers, like Alan Turing and Claude Shannon and Norbert Wiener, they all looked…](https://sms4smile.com/quotes/garry-kasparov/it-s-interesting-that-the-greatest-minds-of-computer-science-the/)

[Garry Kasparov](https://sms4smile.com/quotes/author/garry-kasparov/)

> [We need policymakers to keep an eye on gender and write policies that are explicitly designed to include underserved populations like girls in computer…](https://sms4smile.com/quotes/reshma-saujani/we-need-policymakers-to-keep-an-eye-on-gender-and-write-policies-that/)

[Reshma Saujani](https://sms4smile.com/quotes/author/reshma-saujani/)

> [I shopped at J. Crew in high school, I studied computer science. I was a nerd-nerd, now I'm a music-nerd.](https://sms4smile.com/quotes/mayer-hawthorne/i-shopped-at-j-crew-in-high-school-i-studied-computer-science-i-was-a/)

[Mayer Hawthorne](https://sms4smile.com/quotes/author/mayer-hawthorne/)

> [My high school, the Illinois Mathematics and Science Academy, showed me that anything is possible and that you're never too young to think big.…](https://sms4smile.com/quotes/clara-shih/my-high-school-the-illinois-mathematics-and-science-academy-showed-me/)

[Clara Shih](https://sms4smile.com/quotes/author/clara-shih/)

> [Computer Science is a science of abstraction -creating the right model for a problem and devising the appropriate mechanizable techniques to solve it.](https://sms4smile.com/quotes/alfred-aho/computer-science-is-a-science-of-abstraction-creating-the-right-model/)

Alfred Aho

> [I was on this path to becoming a computer-science guy, but I didn't like it. I got no joy from it. It was very,…](https://sms4smile.com/quotes/kumail-nanjiani/i-was-on-this-path-to-becoming-a-computer-science-guy-but-i-didn-t/)

[Kumail Nanjiani](https://sms4smile.com/quotes/author/kumail-nanjiani/)

> [I think that it's extraordinarily important that we in computer science keep fun in computing. When it started out, it was an awful lot…](https://sms4smile.com/quotes/alan-perlis/i-think-that-it-s-extraordinarily-important-that-we-in-computer/)

[Alan Perlis](https://sms4smile.com/quotes/author/alan-perlis/)

> [I went to Drexel University, majored in computer science. Drexel has a great program - they call it co-op - but its, like, mandatory…](https://sms4smile.com/quotes/john-gruber/i-went-to-drexel-university-majored-in-computer-science-drexel-has-a/)

[John Gruber](https://sms4smile.com/quotes/author/john-gruber/)

> [“I think that it’s extraordinarily important that we in computer science keep fun in computing. When it started out it was an awful lot…](https://sms4smile.com/quotes/alan-j-perlis/i-think-that-it-s-extraordinarily-important-that-we-in-computer-2/)

[Alan J. Perlis](https://sms4smile.com/quotes/author/alan-j-perlis/)

> [I think the combination of graduate education in a field like Computer Science and the opportunity to apply this in a work environment like…](https://sms4smile.com/quotes/satya-nadella/i-think-the-combination-of-graduate-education-in-a-field-like/)

[Satya Nadella](https://sms4smile.com/quotes/author/satya-nadella/)

> [A number of people who are interested in computers in this lifetime programmed computers in Atlantis.](https://sms4smile.com/quotes/frederick-lenz/a-number-of-people-who-are-interested-in-computers-in-this-lifetime/)

[Frederick Lenz](https://sms4smile.com/quotes/author/frederick-lenz/)

> [Computer science is no more about computers than astronomy is about telescopes.](https://sms4smile.com/quotes/edsger-dijkstra/computer-science-is-no-more-about-computers-than-astronomy-is-about/)

[Edsger Dijkstra](https://sms4smile.com/quotes/author/edsger-dijkstra/)

> [Computer Science is the only discipline in which we view adding a new wing to a building as being maintenance.](https://sms4smile.com/quotes/jim-horning/computer-science-is-the-only-discipline-in-which-we-view-adding-a-new/)

[Jim Horning](https://sms4smile.com/quotes/author/jim-horning/)

> [We are lucky in the United States to have our liberal arts system. In most countries, if you go to university, you have to…](https://sms4smile.com/quotes/martha-c-nussbaum/we-are-lucky-in-the-united-states-to-have-our-liberal-arts-system-in/)

[Martha C. Nussbaum](https://sms4smile.com/quotes/author/martha-c-nussbaum/)

> [“We will start by sketching the recursive algorithm and then add details to get to a full description of the algorithm. Footnote : Translation:…](https://sms4smile.com/quotes/sariel-har-peled/we-will-start-by-sketching-the-recursive-algorithm-and-then-add/)

Sariel Har-Peled

[Browse all 280 Computer science quotes ](https://sms4smile.com/quotes/about/computer-science/)

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Quotation",
            "text": "“To write code this way, you need to consider the events that can happen, and how your code should react. Computer science types like to say that this kind of code is asynchronous, because we’re writing code to be invoked later, if and when an event occurs. This”",
            "creator": {
                "@type": "Person",
                "name": "Eric Freeman"
            },
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "url": "https://sms4smile.com/quotes/eric-freeman/to-write-code-this-way-you-need-to-consider-the-events-that-can/",
            "about": {
                "@type": "Thing",
                "name": "Computer science"
            },
            "@id": "https://sms4smile.com/quotes/eric-freeman/to-write-code-this-way-you-need-to-consider-the-events-that-can/#quotation",
            "image": {
                "@type": "ImageObject",
                "@id": "https://sms4smile.com/quotes/i/54d/eric-freeman-7573_computer-science_to-write-code-this-way-you-need-to-consi_2137327.jpg",
                "contentUrl": "https://sms4smile.com/quotes/i/54d/eric-freeman-7573_computer-science_to-write-code-this-way-you-need-to-consi_2137327.jpg",
                "url": "https://sms4smile.com/quotes/i/54d/eric-freeman-7573_computer-science_to-write-code-this-way-you-need-to-consi_2137327.jpg",
                "width": 1080,
                "height": 1080,
                "caption": "“To write code this way, you need to consider the events that can happen, and how your code should react…” — Eric Freeman",
                "creditText": "SMS4Smile Quotes",
                "creator": {
                    "@id": "https://sms4smile.com/quotes/#organization"
                }
            }
        },
        {
            "@type": "BreadcrumbList",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "Home",
                    "item": "https://sms4smile.com/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "Quotes",
                    "item": "https://sms4smile.com/quotes/"
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "name": "Eric Freeman",
                    "item": "https://sms4smile.com/quotes/author/eric-freeman/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "“To write code this way, you...",
                    "item": "https://sms4smile.com/quotes/eric-freeman/to-write-code-this-way-you-need-to-consider-the-events-that-can/"
                }
            ],
            "@id": "https://sms4smile.com/quotes/eric-freeman/to-write-code-this-way-you-need-to-consider-the-events-that-can/#breadcrumb"
        },
        {
            "@type": "WebSite",
            "@id": "https://sms4smile.com/quotes/#website",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "publisher": {
                "@id": "https://sms4smile.com/quotes/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://sms4smile.com/quotes/#organization",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "logo": {
                "@type": "ImageObject",
                "url": "https://sms4smile.com/quotes/wp-content/themes/sq/assets/icons/icon-512.png",
                "width": 512,
                "height": 512
            }
        }
    ]
}
```
