Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
18 July 2025
APIs are the glue that connects different parts of your application together and, whether internal or public, they dictate how components talk to each other. So, should you aim to keep them stable throughout your project’s lifecycle? The surprising answer is, not always.
For most internal APIs, flexibility, not stability, is key. The reality is, we rarely get everything right on the first try. Often, it’s only after using an API in real-world scenarios that you find opportunities to make it more intuitive, efficient, or reliable. Embracing changes and refactoring your internal APIs is part of keeping your codebase in good shape.
For example, let’s say you create an API for handling customer data. Initially, it works well. But as the application grows, you realize it could be more streamlined, or it’s missing certain flexibility for new use cases. By periodically revisiting your internal APIs, you can refine them to avoid long-term technical debt.
Why do clean APIs matter? Keeping internal interfaces clean, easy-to-use, and adaptable minimizes "cruft" – unnecessary complexity and outdated code that can slow down your team over time. When an API feels either awkward or over-engineered, it’s a sign you might need to refactor it.
When your API is public facing, however, stability becomes crucial. Any changes can ripple through to clients, causing breaks or requiring adjustments for external users. This is why public APIs need a different approach.
API source stability guarantees assert that future changes to the API will not break source code written against it. Consequently, developers can rely on the API to remain consistent, avoiding the need for constant rewrites or adjustments as the API evolves. These guarantees are commitments offered by the code or library author, and cover a range of options such as strict source code compatibility (all existing code will run without modification on all future versions of the API), backward compatibility, deprecation and/or sunset periods, version-limited stability, to no guarantee at all (code is in prototype and/or early development).
Whether to provide a source stability guarantee depends on the use case, audience, and lifecycle of the API. If your API is public or widely adopted, if it’s used for a long-term project, or it’s part of a high-level library or framework, then you probably want to consider some form of source stability guarantee so that users of your API know what to expect.
One common example of a source stability guarantee is version-limited stability, conveyed when an API uses Semantic Versioning (SemVer). SemVer provides a formal structure for version numbers and outlines the conditions that allows them to be modified. Below is a short summary; for the full set of rules governing visit semver.org.
While using SemVer within an internal development team might seem like overkill, it helps avoid unexpectedly broken APIs. By building trust and facilitating clear communication about changes, it enhances collaboration both within the team and with any external stakeholders.
One of the biggest benefits of SemVer is that, since any breaking change requires a major version bump, it encourages careful design. Changes must be deliberate to avoid unnecessarily disrupting users. No engineer wants the major version of their component to be in the double-digits, which incentivizes API designers to consider long-term stability and extensibility.
SemVer emphasizes maintaining backward compatibility within the same major version. This principle encourages thoughtful API design practices, such as deprecating features gracefully rather than abruptly removing them and avoiding unnecessary breaking changes that could alienate users or slow adoption.
Application binary interface (ABI) stability ensures that compiled programs can work with updated versions of a library without requiring recompilation. A strategy for maintaining shared libraries, ABI stability makes it easier to roll out bug fixes, security patches, and performance improvements. Maintaining a consistent ABI minimizes disruptions in complex systems without requiring source recompilation, and so helps create long-term system stability.
However, making software ABIs static also imposes constraints on development since it limits changes to function signatures and data structures to avoid breaking compatibility, which leads to accumulating technical debt. This inflexibility means you should offer ABI stability guarantees only when absolutely necessary, not by default. In fact, for internal libraries you may not need public APIs at all, freeing you from carrying the burden of SemVer versioning and a fixed API/ABI, allowing you to make changes at will.
Ultimately, managing API stability is about balancing flexibility and stability. For internal APIs, don’t be afraid to change them as you learn – refactoring helps keep your codebase fresh and maintainable. For external APIs, prioritize consistency to avoid disrupting end users. This dual approach helps you maintain clean, adaptable code internally while delivering reliable, stable interfaces to external clients. For more on this and other software development topics, see our best practice whitepapers.
About KDAB
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications. In addition to being leading experts in Qt, C++ and 3D technologies for over two decades, KDAB provides deep expertise across the stack, including Linux, Rust and modern UI frameworks. With 100+ employees from 20 countries and offices in Sweden, Germany, USA, France and UK, we serve clients around the world.