DEV Community

loading...

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 Author

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 Author

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
ivanjeremic profile image
Ivan Jeremic

No only small websites like facebook can use it.

Collapse
cadienvan profile image
Michael Di Prisco Author

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
ivanjeremic profile image
Ivan Jeremic

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 Author

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.

Collapse
theinquisitor profile image
Info Comment marked as low quality/non-constructive by the community. View code of conduct
The Inquisitor

You think and you are wrong. Don't think and you can't be wrong again.

React is infinitely scalable and used everywhere, but on the other hand, angular is useless like any previous attempt to bring java to the browser.

Collapse
shaijut profile image
Shaiju T

Friend, Different tool is used for different purpose. We as developers should use best tool for the Job. Angular is Google backed, they made it with a purpose. Many companies are successfully using it.

In Angular you have all in one solution on other hand in react you have to plugin maybe 3rd party libraries to get the job done.

Thanks.

Thread Thread
theinquisitor profile image
The Inquisitor

"In Angular you have all in one solution"

That's more a disadvantage than an advantage.

It's not a problem setup react environment but is a problem to develop complex UI with outdated tools like angular, jquery, twig, pug... And yes, I mix them together intentionally because I believe they all got it wrong.

Thread Thread
cadienvan profile image
Michael Di Prisco Author

How can having the same team work in different aspect of the same project be a disadvantage?

None of the mentioned tools are outdated in any possible metric or statistic. Of course jQuery was created to solve problems we don't have anymore, but it doesn't meen it's outdated at all :) I stopped using it 5 years ago, but many people still do and will do for many years and the community is still vibrant. Same for Twig and Pug which are supported by many frameworks from different languages. As per Angular, the roadmap is clear and the community is huge, so I guess your comment is just not fact-based.

Thinking they got it wrong doesn't mean they are outdated. The first is an opinion, the latter is a fact. You can't mix those two things.

Collapse
cadienvan profile image
Michael Di Prisco Author

Krystof, yours is not an opinion but a creed.
React is surely scalable if you know how to do it, but nonetheless Angular gives you a better starter kit for it. You can't deny that.

Thread Thread
theinquisitor profile image
The Inquisitor

Actually, I can. I'm a unix guy and I believe in modularity. One tool should do exactly one thing and be able to communicate with others.

Thread Thread
cadienvan profile image
Michael Di Prisco Author

It depends on what's the "thing" it has to do. Modularity makes sense if you need it, but if you need an app which needs exactly what Angular provides you, it could be feasible and easier to use it than searching and looking for packages in the React ecosystem.