We Are All Hemingway

Rate this content
Bookmark

Do you know that the first novel ever written dates back in 1021. Its author is the Japan noblewoman Murasaki Shikibu. Till then countless of writers put their thoughts on paper and countless of readers experience their stories. People write for decades and we, as software developers, kind of ignore their craft. We write too. Not novels but software. Isn't it this still writing? Believe it or not there is a lot in common between creating fiction and writing code. In this presentation we will see how close we are to giants like Hemingway and Stephen King. Can we get some of their wisdom and apply it to our daily job as engineers. Come to this talk and will get a few practical advices. I hope my presentation will make you a slightly better React developer.

This talk has been presented at React Summit 2020, check out the latest edition of this React Conference.

FAQ

The Wear All Hemi Great Talk is a presentation given by Krasimir Tzonev, who works for Antidote, a company that helps patients reach clinical trials using React in their front-end apps.

Krasimir Tzonev is a developer at Antidote, a company that helps patients reach clinical trials using React in their front-end apps. He is also an author of technical books and is working on his first fiction book.

Antidote is a company that helps patients reach clinical trials. They use React in all of their front-end applications.

Krasimir Tzonev suggests writing about what you know. In programming, this means starting with simple tasks you are familiar with and building on them.

Krasimir Tzonev found that many tips for writing fiction are also applicable to programming. He highlights the importance of writing what you know, managing complexity, and constantly asking questions.

Stephen King advises that when you're writing a story, you're telling yourself a story. When you're rewriting, you're taking out all the things that are not the story. Krasimir Tzonev applies this to programming by asking if each part of the code is essential to the main functionality.

Krasimir Tzonev believes reading code is crucial for gaining experience and improving as a developer. He recommends reading code from colleagues and popular libraries to learn new patterns and solutions.

The 'function-as-child' component pattern is a design pattern in React where a component's children prop is a function. This allows the component to pass values and functions to its children dynamically.

Considering the reader is crucial because code is often read and maintained by other developers. Writing clear and understandable code makes it easier for others to work with it.

The key takeaway is the importance of writing clear and maintainable code by following principles from writing fiction, such as writing what you know, managing complexity, and asking if each part is essential to the story.

Krasimir Tsonev
Krasimir Tsonev
22 min
17 Jun, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

In this video talk, the speaker discusses the parallels between writing and programming, emphasizing the importance of starting with what you know. For instance, in React development, if you're new, begin by rendering a fallback component. The video also highlights the value of reading code from other developers to gain experience. The function-as-child component pattern, exemplified by Formik, is praised for its ability to provide value while maintaining responsibility. The speaker stresses the importance of making code simple for others to understand and maintain, echoing Stephen King's advice to remove unnecessary elements. The talk concludes by emphasizing the need to ask the right questions to find better solutions and improve coding skills.
Available in Español: Todos somos Hemingway

1. Introduction

Short description:

Hey everyone, welcome to the Wear All Hemi Great Talk. My name is Krasimir Tzonev and I work for a company called Antidote. We help patients reaching clinical trials and we use React in all of our front-end apps. Today I decided to share with you the most important tips which I found. And I hope you'll find them useful as well.

♪ Hey everyone, welcome to the Wear All Hemi Great Talk. My name is Krasimir Tzonev and I work for a company called Antidote. We help patients reaching clinical trials and we use React in all of our front-end apps. When I'm not working, I'm pretty much spending time with my family. We have two kids so I have to drive them around a bit for school and kindergarten. I can't cook at home so my wife is cooking. I'm doing the dishes. I used to run before. I'm not running that much recently, but I used to run before. And during all these three activities, I was actually listening to audiobooks. That's how I keep my brain working. And I started by listening to non-fiction books and then I moved to fiction books. And at some point, being an author myself, I was thinking why not make my fourth book a fiction book. So far I was writing only technical books, so I was thinking why not try something else. And I take this as a project, so I started to approach this as I'm approaching all the other my projects, basically checking how to do it, because I don't have experience writing fiction. So I decided to kind of watch a tutorial about it, like in this case it was more of listening to other books, which are books about how to write a book. And I find them really useful and started pulling out some quotes, some tips from there. And when I have this kind of a big list, I was going through the list and I realized that actually, most of these tips were working for software development as well. It wasn't just about writing fiction, for example. Some of these advices were actually really good for programmers. And if you look at the date of the first novel and the date of the first program, we see that there is this huge gap. So probably all these people that write amazing fiction books, they have something to teach us. And roughly at this time, I watched a talk by Jane Creighton at React Conf 2019 called React is Fiction and I was like, oh shit, it's not only me. There are some other people which noticed the same thing. So today I decided to share with you the most important tips which I found. And I hope you'll find them useful as well.

2. Starting with What You Know

Short description:

The first thing in writing, as well as in programming, is to start with what you know. For example, in React, if you're not familiar with writing applications, you can start by rendering a fallback component. Then, as you learn more, you can build on top of what you already know. Complexity arises as you gain knowledge, both in writing and in software development.

So the first thing which I believe most of writers of fiction actually face up is the blank page syndrome when you stare at the blank page and you don't know how to start or you don't know how to continue writing. We have the same thing in programming as well, especially when you join a new team or you just open a new code base or you are maybe more of a junior, you don't really know how to start writing something. And here's what Hemingway say, write about what you know. And this may sound really simple thing, but I found that it works really well, at least it works for me.

So let's take an example. Let's say that we have this component and we have to write this fetching component, it doesn't exist, we just receive this as a task. We know what the API should be, the component should accept URL prop, should have a fallback, which is a component that render when the data is folding. Maybe fallback is not the right naming to be honest, but... then we have the data passed out of the component. So, now if you don't have experience writing React applications, maybe we know something about React but not really a lot. So, if you follow this advice about what you know, you can just start by just rendering the fallback. This is the really basic thing with React, just about rendering something. So we just render the fallback. This is our first step. Then, probably if we start reading the documentation, we'll see this thing called your states, which is like the basic building block about local state management, and we will just reserve a place for the data. If the data is there, we code the children, which we expect to be a function. Otherwise, we just render the fallback components. And at this point, we already have enough, so we could start asking more questions. And I found out that this is a really important stage where you have something to rely on, and then you build on top of it, because if you have nothing, you even know what to ask, actually. So the next step will be to probably ask someone more experienced about how to handle asynchronous operations, how to make HTTP requests, or maybe you just continue reading the documentation, you'll probably find out this hook use effect. And then you place inside the actual request, you get the data, and you send it out using the children function. So this is the first thing which I found useful is when I especially when I start something new, I write what I know, and then I build on top of it. And this really puts you in a position of, of asking questions, which is a really good place to start to do it.

Then when you start knowing stuff, it comes the complexity. When I was listening to all these books, I actually found out that there are complex books as well, the complexity is not only in software. I listened to some books which were, they have many plot lines, they have many characters, a lot of connections between the characters, there are some flashbacks. So I have to be really listening. For example, when I was running, it was difficult to listen to such complex books because I have to really be conscious about what's happening in the book. And we can talk a lot about complexity in software development, especially in our JavaScript ecosystem. And here is what Stephen King says about writing.