VOOZH about

URL: https://thenewstack.io/how-to-code-first-with-design-first-benefits/

⇱ How to Code First with Design-First Benefits - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2024-04-02 07:16:29
How to Code First with Design-First Benefits
sponsor-nitric,sponsored-post-contributed,
CI/CD / Software Development / Software Testing

How to Code First with Design-First Benefits

By coding early, we can validate ideas, identify technical constraints and refine our design based on practical insights and keep the project's goals in focus.
Apr 2nd, 2024 7:16am by Rak Siva
👁 Featued image for: How to Code First with Design-First Benefits
Image from Frogella on Shutterstock.
Nitric sponsored this post.

The preference between starting with design or jumping straight into coding often depends on the context of the project, the individual developer’s or team’s workflow and the complexity of the task at hand.

Focusing on design before delving into coding is widely recommended for a variety of reasons. A design-first strategy promotes careful planning and prioritizes the user’s perspective, guaranteeing that all parties involved have a unified understanding of the project’s goals. On the other hand, prioritizing coding fosters agility and swift development and prototyping, albeit at the cost of forgoing some of the advantages of having an upfront design.

Code-First or Design-First: A False Dichotomy

The problem with this supposed choice between design-first and code-first is that beginning with code doesn’t have to mean skipping the design phase, nor does it mean fully implementing the application. Rather, it’s about embracing an iterative approach in which design and development inform and complement each other from the start. By coding early, we can quickly validate ideas, identify technical constraints and refine our design based on practical insights, all while keeping the project’s vision and goals in focus.

What if we could code first and also gain the benefits of design-first approaches by automatically generating visualizations to complement our code?

Many aspects of software development involve abstract concepts or complex systems. Visualization helps break down these complexities into more digestible, understandable parts. This applies across the entire spectrum of a software engineering team, affecting developers, architects, testers and project managers in distinct yet interconnected ways.

When it comes to the abstract concepts of infrastructure, concrete visual representations give each team member insights that foster a holistic understanding of the software itself.

Code First and Leverage Automated Design Visuals

By coding a scaffold or template first and using automated visualizations, teams get a code-first method that doesn’t undervalue design; instead, it integrates design thinking throughout the development process and provides the following advantages:

1. Early Detection and Resolution of Design Issues

Automated diagrams can help identify architectural issues or bottlenecks early in the development process. By visualizing the system structure and dependencies, teams can spot inefficiencies, unnecessary complexities or scalability concerns, allowing for prompt adjustments before these issues become more challenging to address.

2. Enhanced Communication with Stakeholders

Visual representations of the system’s architecture make it easier for all stakeholders, including those with non-technical backgrounds, to understand the system’s workings and contribute meaningfully to design discussions. This inclusive approach to project communication ensures that decisions are informed and reflective of a broad range of perspectives.

3. Agile and Continuous Documentation

Teams can rapidly prototype and iterate on their code, with automated tools generating updated diagrams at each stage. Automating the generation of diagrams ensures that the project’s visual documentation is always up to date. This continuous documentation process alleviates the common problem of outdated diagrams that no longer reflect the current state of the codebase, thus maintaining an accurate representation of the system architecture, data flows and service interactions.

Automating Design Visualizations from Code

The visualization functionality I’ve been describing above is a feature now available in the open source Nitric framework, which gives me an easy way to demonstrate how code scaffolding paired with automated design visualization can help teams. I’ll use a bookstore application as an example, scaffolding the key components with Nitric.

We’re going to create an API for a library or bookstore that handles the storage and retrieval of meta information about books. To accomplish this, we’ll import the following building blocks.

We’ll then use these resources to implement our Rest API using these resources. Here is an example of the POST method and some placeholders for the other methods we’ll need to implement in the future.

With just a small amount of partially implemented code, we are ready to visualize our application’s infrastructure requirements.

👁 Image

Armed with this initial template and visual, we can now jump into design discussions. Because of the dynamic aspect of the visualization, adjustments can be made swiftly and their implications understood at a glance.

Team Collaboration on App Design

While we started with coding, the addition of a diagram shifted the team focus away from individual code analysis to a collaborative discussion on implementation.

As we progressively build out this application, one of the next logical questions for the dev team might be something like, “How will other parts of the app know that a book has been created/deleted/updated?”

The team can quickly refine the code scaffold to include event messaging for book-related actions. Upon creating or removing a book, the app will publish an event, thereby allowing other services to subscribe to deliver future functionality such as reporting, inventory analysis, etc.

With these changes made, the visual updates to show the new design:

👁 Image

Early Design Optimizations for Greater Efficiency

So far, we haven’t implemented any code to handle subscribing to the topics book-created or book-removed. However, through analysis of the visualization we have already enabled our team to begin considering optimizations. In this example, we can start to debate whether we have published different topics for when a book is updated. Depending on the circumstances, it might be a better approach to merge `created`and `removed` to simply `updated`. Alternatively, we could also introduce a new state variable within the message body to capture if it was an update or a created event. This analysis could lead us to reduced costs and a reduction in repetitive code.

Detecting Resource Utilization Issues

Inspecting the design visualization also makes it easy to identify rogue resources that have been declared. For example, the following visualization reflects a code update through which we’ve introduced buckets that store book covers for reading and write access. Our plan is to find a more optimal solution for handling or retrieving covers in the future; perhaps we plan to use a viable third-party API.

A quick inspection of the visualization shows no connections between the `book-covers` bucket and the `books.ts` handlers. We can immediately see that this resource is rogue and adjust as needed before the code is fully built out and well before any costly rogue resources are deployed to the cloud.

👁 Image

Try It for Yourself

Starting a project with a rough code scaffold helps teams move forward quickly, but can often result in design gaps if not paired with the right planning discussions. Automatically-generated design diagrams are the powerful tools that next-level teams use to streamline design, development and maintenance phases of projects.

Teams that use code scaffolds and automatic architecture diagrams gain efficiency and agility so that they can rapidly prototype and iterate. They improve their application quality and reliability by identifying design flaws and bottlenecks early. And finally, they align development more closely to business goals through better understanding, communicating and decision-making in collaboration with business stakeholders.

Test out automated diagramming to get a sense of how this approach can accelerate your next project. You can experiment with tools like Nitric; with its simple CLI, you can quickly generate diagrams by coding a template of the required resources for your application. From there, you’re on your way to fostering a collaborative environment where everyone shares a unified vision of your application’s architecture.

Nitric is the cloud-aware framework that enhances developer productivity and ops confidence, uniting backend and infrastructure code to build and ship cloud apps fast. Devs build your application, Platform determines the right infrastructure and Nitric automates provisioning that works for both.
Learn More
The latest from Nitric
Hear more from our sponsor
TRENDING STORIES
Rak Siva, vice president of engineering at Team Nitric, is deeply committed to elevating the experience for software developers. With a rich 15-year tenure in the software industry, he began his engineering journey immersed in the exhilarating challenges of the...
Read more from Rak Siva
Nitric sponsored this post.
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.