I’ll keep updating the article whenever I learn other tips that deserve to be in the top 10. Feel free to let me feedback. I’d love to learn from you.

Ready? let’s start

1- One UI Component library will make your life easier and your app responsive.

Using an already existing UI library is more comfortable, faster, and consistent. You don’t need to write extra code for a component that already exists, works, and is well maintained.

  • Use one UI library such as Angular Material, NgBootstrap, or PrimeNG.
  • Use a layout framework like the bootstrap grid, Flex layout.
  • Writing your own CSS/SCSS will slow down your app, make it inconsistent and hard to maintain.
  • Only create your own UI library if you have enough projects that need a specific design.

2- Use types instead of any in your typescript code

The compiler treats any as “please start type checking for this thing.”. Typing is the cheapest and faster way to check errors in your code. With any, it’s challenging to see what’s going wrong, and in terms of performance, it will cost you a lot. However, this exists for some exceptional cases where the use of any will be understood. Those cases are:

  • When you are migrating a project from Javascript to TypeScript.
  • In Unit tests, to avoid declaring the whole mock object.

#web-development #typescript #angular

10 Tips for a clean and well coded Angular App
20.00 GEEK