How I Prepare Before Coding a Feature

Starting a new coding project or feature can be exciting, but jumping in too quickly is easy without proper planning.

Asking the right questions before you start can save you time and headaches.

Illustration of a man at a desk drawing a map with an open laptop

It might feel like wasted time, but whenever I forget these steps, I regret it later.

Here's what I do before diving into the code:

Understand the Why

Before you write a single line of code, understand why you're building this feature.

  • What problem does it solve?
  • Who is it for?

This helps you stay focused on what's important, ensuring the feature adds value.

Sometimes, we get caught up in cool ideas that don't serve a clear purpose. If you can show your stakeholders that there are more valuable additions to be made, you can often avoid building the wrong things.

Always start with why.

Know the Requirements

Get clear on what the feature needs to do.

What are the must-haves and the nice-to-haves?

This can involve talking to stakeholders, like customers or team members, to understand their needs. Knowing the upfront requirements helps prevent scope creep, where features keep adding, making the project bigger than initially planned.

In a work setting, I'll sit with whoever made the requirements and find out what's important so that I can estimate my effort accordingly.

Prioritize Simplicity

Ask yourself, how can I keep this simple?

Complexity is the enemy of execution.

The more complex a feature, the harder it is to build, test, and maintain. Aim for the simplest solution that meets the requirements. This doesn't mean cutting corners; it means choosing the approach that gets the job done without unnecessary bells and whistles.

You can refine it later, but don't overengineer early!

Consider the Impact

Think about how this feature fits into the bigger picture.

Will it affect other parts of the project?

How will it integrate with existing features?

It's essential to consider the downstream effects to avoid breaking something else or creating a maintenance nightmare.

Adding something new means refactoring or improving other areas first.

Without these considerations, I've often fallen prey to "this looks easy" and then ended up with weeks of pain...

Plan for Testing

The most common complaint I hear from teams is, "We didn't have the time to test."

And to put it simply, what bullshit.

Developers plan their tasks and give estimates. So, if you haven't factored in the time to test, it is because you forgot to.

Rant over...

Back to the practical; how will you know if the feature works as expected?

Plan your testing strategy before you start. This includes thinking about unit tests, integration tests, and manual testing.

Knowing what success looks like helps you write better code and catch issues early.

Assess the Resources

Do you have everything you need to start?

This includes time, tools, and access to specific data or APIs.

If you're working in a team, do you need input or assistance from others?

Assessing your resources helps ensure you're not stuck waiting for something you could have planned for.

If you need a few hours from someone, factor that into their time, too, or else you may end up frustrated later.

Document Your Approach

Finally, take some time to sketch out your approach.

This doesn't have to be formal documentation; jotting down a rough plan can help clarify your thinking.

It's also helpful in getting feedback from others before you're too far down the path.

It's much quicker to double-check your ideas before you code, and your team leads will love you because of it.

Jumping into coding without asking these questions is like setting off on a trip without knowing your destination or what you'll need.

It might be fun initially, but you'll likely run into problems.

Taking some time to plan can make the journey much less chaotic and stressful.

And remember, it's okay to adjust your plan as you learn more.

The goal is to be thoughtful about the process rather than rigidly following a plan that does not work.

Avatar for Niall Maher

Written by Niall Maher

Founder of Codú - The web developer community! I've worked in nearly every corner of technology businesses; Lead Developer, Software Architect, Product Manager, CTO and now happily a Founder.


Fetching comments

Hey! 👋

Got something to say?

or to leave a comment.