When should you abstract code away? (with basic React example)

preview_player
Показать описание
knowing when to abstract away code is important. It helps keep your code clean and reusable, but if done too much, it can make your code base hard to manage and follow.

------------

Рекомендации по теме
Комментарии
Автор

I agree with your points: creating utilities for situations where you keep writing the same/similar thing over and over, and when you're trying to insulate your codebase against direct library dependencies. The second point is really clever ... I wouldn't have thought of it like that. That's probably why more professional code-bases tend to have an api wrapper folder, right? So that they can configure and swap out fetching libraries as required and allow the changes to immediately propagate to the rest of the project. I'm learning 🤓🙏🏽💯

ozzyfromspace
Автор

This is really helpful. I learnt a lot. Thinking long term while coding

ccanyanwu
Автор

For simplisity instead of then catch us async await

sabasayer
visit shbcf.ru