Friend, what slows you down most while coding?
It's not lack of skill. I know you're awesome.
It's not lack of ideas. You got plenty.
It's uncertainty. Fear. "What do I do next? Will reviewers rip this to shreds? Is it good enough? Does it perform okay? Is this the right name to use?"
You see this with engineers and other creative pursuits. The fear of imperfection, the drive to get it right the first time.
But that's not how it works my friend. You can't get it right the first time.
The blank file of doom
The blank canvas is your biggest foe.
Click that 👆, it's one of my favorite comics.
Why are you keeping that canvas blank? Start. Type something
When a new file scares you, here's what you do: lfaekwjflawkjalc
The Senior Minset email crash course
Get a free chapter from the Senior Engineer Mindset book and a sample audiobook chapter, followed by a Senior Mindset 101 email course.
You'll get insights to apply at your work right away.
Yes really. Slam the keyboard and build momentum. Once you're typing the code starts flowing.
Better yet 👉 don't open a new file. Write new code next to the old code. Move it to a new file later.
Naming is hard
There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors.
Except naming's not hard. You just don't know what you're building yet.
A trick I learned back in my fiction writing days is The Placeholder. You don't have to decide everything right now. Write.
When you write a novel in a month your target is 1666 words per day. I did it once. You have no time to stop. Heckin' fun.
Same is true for coding. Build the damn thing and you'll find out what it does.
Last week I built a new component, called it Bloop
.
Then I got dirty. Tried a bunch of things, explored what I'm doing. Used code to think. When the component worked, its true name was obvious.
Don't fear the mess
embrace the mess! Mess is how you learn.
A fear that stops you in your tracks is that you'll get it wrong. "Hmmm not sure how this works, I better go research online."
TRY IT! Just go for it! It's code, it don't bite. I promise.
Like that time I learned a whole new TypeScript concept that blew my mind. "I wonder if this works ..."
this one's for you @tannerlinsley
— Swizec Teller (@Swizec) February 19, 2021
My favorite part is that generics don't work just for hooks and functions. You can genericify types as well 🤯
Love it when you try a crazy thing and it just works. pic.twitter.com/KTk556XMP2
And it did work!
Kids have us beat in this regard. They try shit and see what happens. It's the fastest way to learn. Get in there and muck about! See how it goes.
What's the worst that can happen? Oh are you gonna get a error? Cool! Fix it :)
Make bets and let small fires burn
The other thing that slows you down is fear of mistakes. Not like "oops that's a weird name for a function" but mistakes like "oops I deleted the production database"
Don't delete the production database.
Do consider the consequences of your decisions. How big are they really? How likely are they?
If your code runs 100 times per day and you wrote a 1-in-10,000 bug ... do you think it's worth worrying about? The bug that happens once every 10 days?
You do have to weigh probabilities against consequences. Don't drop your production database every 10 days 😂
Thinking in Bets is a great book about this mindset. You can decide faster if you think like a bet: "What's the consequence? How likely is it? Okay do the thing"
Make the decision and move on.
And don't forget, something is always on fire. Focus on the biggest fire, let small fires burn. Not every bug or detail is worth your time.
The vomit draft
Another trick from the writing world: The Vomit Draft.
Your first draft gets the ideas out. The code working. An embarrassing mess.
Guess what you can do with an embarrassing mess? Fix it. Edit.
Make a pull request and get feedback. Show screenshots to designers and get feedback. Show it to your product owner and get feedback.
You can polish until it's perfect enough. But an empty file ... can't do much with that.
Start. Don't stop. Keep going. You can always fix it later. ❤️
Cheers,
~Swizec
PS: this applies to everything
Continue reading about Can you code faster?
Semantically similar articles hand-picked by GPT-4
- Flow good for programming, not engineering
- Don't neglect your upgrades
- Sucking is the first step
- Most professional engineers can't build an app from scratch
- Why senior engineers get nothing done
Become a *true* Senior Engineer
Get promoted, earn a bigger salary, work for top companies
Getting that senior title is easy. Just stick around. Being a true senior takes a new way of thinking. Do you have it?
The Senior Minset email crash course
Get a free chapter from the Senior Engineer Mindset book and a sample audiobook chapter, followed by a Senior Mindset 101 email course.
You'll get insights to apply at your work right away.
Have a burning question that you think I can answer? Hit me up on twitter and I'll do my best.
Who am I and who do I help? I'm Swizec Teller and I turn coders into engineers with "Raw and honest from the heart!" writing. No bullshit. Real insights into the career and skills of a modern software engineer.
Want to become a true senior engineer? Take ownership, have autonomy, and be a force multiplier on your team. The Senior Engineer Mindset ebook can help 👉 swizec.com/senior-mindset. These are the shifts in mindset that unlocked my career.
Curious about Serverless and the modern backend? Check out Serverless Handbook, for frontend engineers 👉 ServerlessHandbook.dev
Want to Stop copy pasting D3 examples and create data visualizations of your own? Learn how to build scalable dataviz React components your whole team can understand with React for Data Visualization
Want to get my best emails on JavaScript, React, Serverless, Fullstack Web, or Indie Hacking? Check out swizec.com/collections
Did someone amazing share this letter with you? Wonderful! You can sign up for my weekly letters for software engineers on their path to greatness, here: swizec.com/blog
Want to brush up on your modern JavaScript syntax? Check out my interactive cheatsheet: es6cheatsheet.com
By the way, just in case no one has told you it yet today: I love and appreciate you for who you are ❤️