How TypeScript design patterns help you write better code

Click for: original source

TypeScript is a language that has seen a lot of exposure in the modern world of software engineering. Its powerful, strict type system reduces the likelihood of running into errors during runtime or hidden bugs in production due to the lack of strong types in, JavaScript, TypeScript’s predecessor. By Eslam Hefnawy.

While TypeScript makes the development experience smooth on its own, it’s important to know how a design pattern can help retain or improve the efficiency and usefulness of a codebase. Using the right design pattern in the right situation and knowing how to do so is a crucial skill in any developer’s toolbox.

The article main content is about following patterns:

  • The observer pattern: I know what happened to you
  • The builder pattern: Few subclasses, few problems
  • The proxy pattern: The ideal middleman
  • Use the right design pattern in the right situation

Most importantly, design patterns are language-agnostic and can be implemented in any language to solve the kind of problem that a particular design pattern intends to solve. Good read!

[Read More]

Tags react javascript web-development app-development