Video Summary
Back in 2014, I was having lunch with a friend.
I had just started my very first developer job, at a very tiny company: it was me and one other developer. We were both very new, and didn't really know what we were doing.
The friend I was meeting had been working for a few years as a software engineer at Twitter. I met her on-campus for lunch. Back then, Twitter was seen as a rising star, and they had all the typical Silicon Valley perks. Their cafeteria had master chefs, doing knife tricks and preparing the most gourmet food I had ever seen.
So in this amazing plaza, surrounded by world-class engineers, we sit down to eat, and I start telling my friend about my job: it's alright, but I don't really know what I'm doing. It feels like I'm just hacking stuff together. I'm not confident at all that I'm doing it right.
My friend looks at me, and she says “That's how everyone feels. That's how it is here at Twitter. None of us know what we're doing, we're all sticking things together with duct tape and hoping they hold.”
“There is no moment in your journey where you reach Expert Status, where every line of code that you write is perfect and every best practice comes to you naturally. That's not really the way it works.”
Sure enough, almost a decade later, I can confirm she was right. 😅
A few years ago, I worked for a company called Khan Academy. Khan Academy is notable in the React community for being one of the earliest non-Facebook organizations to adopt React. An engineer named Sophie Alpert had started moving the codebase from to React before it was even formally announced.
And so, when I joined Khan Academy, I sorta figured it would be this bastion, with the best React code I'd ever seen, all of the best practices neatly followed… And it was not that. There was a ton of daylight between the established “best practices”, and what we had been doing.
And yet, Khan Academy as a platform worked very well. And while some decisions did have a bit of an impact on developer productivity, overall we were an effective team, getting things done, building a good product.
It made me wonder: how much harm is there, if we don't follow all of the best practices?
Modern hooks-based React is tricky. There are a lot of best practices, and they're hard to follow. For example, if you ever share your useEffect
code on Twitter, you'll likely hear from lots of well-intentioned and very smart people about how you're doing it wrong.
This advice can often feel overwhelming, like it's impossible to come up with the perfect solution or to do things right. I think sometimes we take this advice too seriously.
I started this course platform in early 2020, a few months after hooks had been released. At the time, none of us really knew what we were doing with hooks, we were all figuring it out as we went. I look back now at code from a couple years ago and I'm embarrassed by it. It isn't following any of the best practices I teach in this very React course!
And yet, the platform seems to work pretty well. Users can't see how messy some of the code is.
To be clear, I'm not trying to say that “Best Practices” don't matter. We should always strive to be better, and it does indeed help if we follow the best practices. But the consequences are not life and death. You should never feel shame or guilt for writing code that doesn't comply with all of the best practices.
Ultimately, we're all learning, and the most important thing is that we're always improving. If we ever get to the point where we look at code we wrote a couple years ago and we're not a little bit embarrassed by it, that's a problem, since it means we're stagnating.
So: be patient with yourself, be forgiving with yourself, and don't forget to have fun!
This video is an excerpt from The Joy of React, a comprehensive, interactive resource for learning React. Learn more:
Check it out!Check out “The Joy of React”