DEV Community

Discussion on: The best way to learn React is.. to learn Angular?!

Collapse
 
shaijut profile image
Shaiju T

Nice 😄,

I think Angular is for large projects.

React for mid size projects.

Is React maintainable for large projects ?

Collapse
 
giovanniincammicia profile image
Giovanni Incammicia

Hi SaijuT, I've been working with React for 5 years now on projects of every size.
In my opinion, it is possible to have a large maintainable React project, but you really need a strong architectural design at the root to create the perfect folder/code structure for that project.
The biggest issues in React are component responsibility, communication and state-management. If every component is in the right place in the architecture and everything is done perfectly, then you're good.
Also, it's really important to think in React. Sometimes I see projects with a mix of React-style functional code, javascript classes (OOP stuff in general), hoc and other patterns.
Mixing is not good for maintainability. Which brings us to have a team that writes the same code (eslint helps with that). If not, it's just a nightmare.

Using a framework like Next.js or a state-management library like Redux helps less-experienced devs to have a forced structure which improves maintainability. Typescript and tests are also a must.

At the end of the day, maintainability is a matter of best practices and well-designed software. Sometimes we, as developers, prefer spending more time on coding than on planning stuff on a piece of paper.

This is just my opinion and experience so far. What do you think? :)

Collapse
 
cadienvan profile image
Michael Di Prisco

I completely agree with you. As soon as I started working with React I realized I could easily lose the point where some data is populated and passed in other parts of my application, nonetheless a nice architecture is built project after project and I'm pretty sure React can be used for big projects too. Thank you for sharing your experience Giovanni, and of course thanks SaijuT for the good question!

Collapse
 
shaijut profile image
Shaiju T

Appreciate 😄, for taking time to write. Actually as of today I have just learned Angular basics. Right now I am not in right position to compare both. But i asked the question with intention of just knowing what others think.

Few more questions:

  1. What you think about Angular is it more maintainable with build in Typescript support or is it up to the developer to make the project maintainable ?
  2. Have you used Typescript to build React apps or Just vanilla Javascript ?
Thread Thread
 
giovanniincammicia profile image
Giovanni Incammicia

I've used React with both vanilla Javascript and Typescript. My opinion on that is that with Typescript you don't have to worry about static type errors. It's just another thing off your mind. And kind of forces you to design more because you have to think in advance what kind of data you have/receive. So yes, it really helps with maintainability. Also, it's easier for other people to read through your code and know instantly if that prop is supposed to be a string, a number or both.

I don't know much about Angular, but what I know is that it has more of a horizontal structure, compared to the tree-like structure of React. This means that in Angular you have a few folders with many files, while in React is easier to work with many folders (one per component) with usually a lot of files within (js, styles, tests, reducers for state-management, schemas and types, API calls and so on).
Of course, in either of them, you can structure the folders as you most like them. But usually, you wouldn't want to go against the way the library thinks.

I hope that makes sense! :D

Thread Thread
 
cadienvan profile image
Michael Di Prisco

I'll give my two cents on the thread: React is more "free" and, in my opinion, is less feasible for junior developers. Even if angular has a steeper learning curve, it provides structure, rules and linting, something you have to do yourself in React. That's the point of this topic: React is empowered by Angular, in some ways.

Thread Thread
 
giovanniincammicia profile image
Giovanni Incammicia

Absolutely agree. Many things done by create-react-app (mostly linting and structure rules) have probably been taken from Angular and frameworks from every language. I believe we could gain experience from every library/framework we learn and use it with the most appropriate for the project (or simply our favourite, in simpler cases :) )

Collapse
 
ivan_jrmc profile image
Ivan Jeremic

No only small websites like facebook can use it.

Collapse
 
cadienvan profile image
Michael Di Prisco

Eheh as said in other comments, React CAN be used for big projects, of course, but still isn't created to do so. And, by the way, Facebook's UI is nothing too fancy or special and React is a perfect suite for it. You can tell me Facebook has an incredible top-notch back-end, but UI and front-end in general is not in the "Top 10 hardest websites to build" IMO.

Thread Thread
 
ivan_jrmc profile image
Ivan Jeremic • Edited

Then you have not updated to the new Facebook UI on desktop and React is 100% created for big projects what are you talking about? the component model is the only way different teams can work on different parts in the UI the best. Facebook has a new website now, and it is not simple and one of the most advanced UIs out there. And Twitter, Binance trading market, Tweetdeck (WebApp), Reddit, Techcrunch, and many more disagree with you.

Thread Thread
 
cadienvan profile image
Michael Di Prisco

I don't agree with the new Facebook being "one of the most advanced UIs" in the web world, but it's an opinion and I can accept it. I never said it doesn't work in big projects, I'm just saying it works in medium-small ones in its simplest form and has to be mastered before you can use it in big projects.