In these past years I have experienced a big shift in my career, as I transitioned from a developer writing code for startups to a managerial/architectural role for enterprise applications. The main difference between both is mainly the number of people working together: an enterprise application has 4 or 5 teams between 2 to 5 people collaborating on the same project.
The inspiration for this article was a post on Hacker News titled “I Almost Got Fired for Choosing React in Our Enterprise App”. My comment got a fair amount of attention, so I decided to describe some of the most common pitfalls when working on a big enterprise project. Over the years I have made a lot of mistakes and I have tried to learn the most from them. That being said, don’t take me very seriously, as I am always about to discover a new mistake I missed.
The problem with enterprise is not about the framework (react / angular / vuejs / jquery / vanilla / web_components), the problem is how to align big team to create a cohesive application. If a big team is going to be working on it you need some strong opinions around it. Below you can find five basic tips that may be helpful for you in the same situation:
Do not mess with the package.json. I can’t stress this enough. Actually, the most important file in your whole application is the package.json. Almost nobody should be allowed to add additional dependencies because is the main point to generate chaos and problems in the long term.
The design system matters a lot. Have a small team working on the UI components to tailor and extend the design system. Don’t allow the rest of the teams to extend the components with new libraries. Stick with the design system as much as you can. The rest of the teams should minimize the amount of CSS they have to write to components placement.
The datagrid is the soul of any enterprise application. Choose it wisely and be sure it covers as much functionality as you can, and also that it is customizable on an “easy” way. There is always a team with the need of a datagrid that sorts, groups, filters the data with dynamically adjustable cells and multi header items without pagination. Welcome to hell.
Use one pattern: hooks, central store, whatever you want. If at some point you have to change it you have to know which teams are using which one. Don’t allow team members of the same team follow different patterns. Code reviews must take care of this.
Readability is the most important feature of your code. Dozens of developers with different seniority are going to have to understand the code you write, they will have to find bugs in it, they will need to extend the functionality or they will have to refactor. When you write code for an enterprise application, you should be thinking on simplifying the life of your future you when have to extend your code in 3 years from now (and you have lived those years in Bora Bora with no internet connection).
Hope these small tips help one or two teams out there. I have worked on the migration of 5 big enterprise applications from angularjs to react or from legacy desktop application to react or from server pages to react.