Daily Shaarli

All links of one day in a single page.

February 14, 2026

Types vs. interfaces in TypeScript - LogRocket Blog
thumbnail

We have two options for defining types in TypeScript: types and interfaces. One of the most frequently asked questions about TypeScript is whether we should use interfaces or types.

The answer to this question, like many programming questions, is that it depends. In some cases, one has a clear advantage over the other, but in many cases, they are interchangeable.

In this article, I will discuss the key differences and similarities between types and interfaces and explore when it is appropriate to use each one.

Let’s start with the basics of types and interfaces.

When to use types vs. interfaces

Type aliases and interfaces are similar but have subtle differences, as shown in the previous section.

While almost all interface features are available in types or have equivalents, one exception is declaration merging. Interfaces should generally be used when declaration merging is necessary, such as extending an existing library or authoring a new one. Additionally, if you prefer the object-oriented inheritance style, using the extends keyword with an interface is often more readable than using the intersection with type aliases.

Interfaces with extends enables the compiler to be more performant, compared to type aliases with intersections.

However, many of the features in types are difficult or impossible to achieve with interfaces. For example, TypeScript provides rich features like conditional types, generic types, type guards, advanced types, and more. You can use them to build a well-constrained type system to make your app strongly typed. You can’t do this with interfaces.

In many cases, they can be used interchangeably depending on personal preference. But, we should use type aliases in the following use cases:

  • To create a new name for a primitive type
  • To define a union type, tuple type, function type, or another more complex type
  • To overload functions
  • To use mapped types, conditional types, type guards, or other advanced type features

Compared with interfaces, types are more expressive. Many advanced type features are unavailable in interfaces, and those features continue to grow as TypeScript evolves.

Below is an example of the advanced type feature that the interface can’t achieve.

type Client = {
    name: string;
    address: string;
}
type Getters<T> = {
    [K in keyof T as `get${Capitalize<string & K>}`]:  () => T[K];
};
type clientType = Getters<Client>;
// type clientType = {
//     getName: () => string;
//     getAddress: () => string;
// }

Using mapped type, template literal types, and keyof operator, we created a type that automatically generates getter methods for any object type.

In addition, many developers prefer to use types because they match the functional programming paradigm well. The rich type expression makes it easier to achieve functional composition, immutability, and other functional programming capabilities in a type-safe manner.

The Hidden Cost of AI Art: Brandon Sanderson's Keynote

Some of you may be able to guess what’s been on my mind lately. In April 2010, film critic Roger Ebert made an infamous claim. He said, “Video games can never be art.” His blog post set off a firestorm of discussion, centered around the idea that he was an out-of-touch, old man who didn’t understand games. While I disagree profoundly with Mr. Ebert, he was an intelligent, articulate scholar, and had a better point than his clickbaity quote might imply.

EcoLogits - EcoLogits
thumbnail

Project

EcoLogits is a suite of open source tools for estimating the environmental footprint of generative AI models at inference. Based on life-cycle assessment principles, the project raises awareness about the direct environmental impacts of AI while empowering developers and organizations to build more sustainable AI-powered applications.

  • Open & transparent – Code, methodology, and data are openly accessible.
  • Ease of use – Emphasizes on seamless integration and user experience.
  • Community-driven – Continuously built and improved collaboratively.
Software Craftsmanship in the AI Era

Sandro Mancuso, Co-founder and Group CEO

AI is Changing How We Code

AI coding tools are completely changing the software development landscape. Developers now rely on tools like GitHub Copilot, Amazon CodeWhisperer, and ChatGPT to generate code, fix bugs, scaffold tests, and accelerate routine tasks. Code that once took hours can now be produced in minutes; sometimes seconds. Prompting is quickly becoming a core developer skill.

AI is here to stay. The promise is undeniable: higher output, faster delivery, and fewer repetitive tasks. But with this leap in speed, a deeper question emerges:

Are we building well - or just fast?

This article explores that question through the lens of Software Craftsmanship, offering a pragmatic perspective on how to embrace AI without sacrificing the principles that make great software possible.