Skip to content
Go back

How to Write Better Code Faster

Edit page

Today I attended and very much enjoyed a webinar hosted by Rahul Pandey and Alex Chiou of Taro. Both Rahul and Alex are ex-tech leads from FAANG companies. The title of the webinar is “How To Write Better Code Faster As A Software Engineer”. These are my notes from the webinar.

There are two axes to being a good “code machine”.

  1. Quality
  2. Velocity

“Code Machine” is a recognized archetype of staff engineers at certain larger tech companies. Another archetype of a staff engineer might be “Product Manager” for those excelling in that skillset.

A common misconception about delivering lots of software quickly is that you have to sacrifice quality. High quality code is conducive to high output. This is important at any level of engineering. Alex states that even the highest level of engineers, despite having more meetings, still spend about 20% of their time writing code.

Code quality is by far the most misunderstood metric.

You can always throw more hours to increase quantity, you cannot do so for quality.

Velocity

The following are ideas for how to think about and optimize coding velocity.

Go deep, not wide

Be tactical with meetings

A common failure mode is to attend every meeting on your calendar.

Coding is heavily momentum oriented. Context switching is really disruptive, takes a long time to get the context and setup the environment to write code.

An engineer with 1 x 8 hours blocks of time will produce twice as much as code as an engineer with 4 x 2 hour blocks of time.

Look for patterns

All tech stacks follow a power law.

Do side projects

Other benefits of side projects:

Time spent after writing code

What is the breakdown of how time is spent once a PR is submitted. For example, what happens once you write the code to getting it landed (e.g. committed to main).

A novice engineer will:

A pro engineer will:

The goal is that you want this cycle to to be super quick. The pro engineer explains very well what they are doing and anticipates the questions that other people will have in the test plan summary. This allows the PR review to be expedited.

Comparison of time spent after writing code

Credit for image to Taro.

Quality

Create a plan

The above idea matches some advice from a chapter in A Philosphy of Software Design by John Ousterhout. It is always a good idea to explore alternatives to your initial approach to a problem.

Submit clean pull requests

Treat code review feedback as a massive gift

Review code from others

Modularize your code

Keep it consistent

Do the simple thing first

Make it a little better each time

Where to go next?

Being proficient at coding is just the beginning. Writing code is operating at a local level. The next level is system design which involves the following:

Conclusion and final thoughts

I enjoyed this webinar and found the advice to be true based on my own personal observations. I will definitely be focusing on making smaller commits and writing even more thorough test plans in my PRs as well as including more screenshots and explanations of how the code I’ve authored changes the state of the world.

I also plan to focus on shortening my cycle as a developer from submitting code to landing it in main.

Even though it is obvious, protecting time on my calendar to allow for uninterrupted blocks is something I will be more closely monitoring at work. I’ve noticed my own calendar being filled with meetings five days per week with fewer focus blocks.


Edit page
Share this post on:

Next Post
Learning & Configuring tmux