DEV Community

Discussion on: I've hit a brick wall. How do I progress as a React Dev and other confusions.

Collapse
 
alekseiberezkin profile image
Aleksei Berezkin • Edited

Hi Sandeep

some feature addition requires either a lot of refactoring

This means you are on the right path! You understand that the code needs to be clean in order to add features.

Now, how to code to avoid the constant need to refactor... This is tough question indeed; unfortunately even mature projects sometimes require refactorings or even complete rewrites. And that's not always because of design mistakes: not everything may be foreseen in the beginning.

SOLID principles are certainly helpful. But keep in mind they are designed mainly for OOP which is not considered today as the only way to code. The most universal principle IMO is orthogonality: try to design different parts of application so that they don't depend on others implementation details. That's not 100% possible but can be achieved to some degree.

Helpful thing is defining boundaries between components, and that's where TypeScript shines. It allows you to clearly define API: object shapes, functions etc which are used to transfer data between components.

Keep going and good luck!

Collapse
 
sandeepgamot profile image
SandeepGamot

Thanks alot aleksei!!