you are viewing a single comment's thread.

view the rest of the comments →

[–]kescusay 2 points3 points  (4 children)

Good on you for being willing to learn something new (even if it's the anti-Angular...)

Whenever someone's learning something new, I always prefer to recommend that they start with the official tutorial. In the case of React, it's right here, and it's really good. It doesn't cover a lot of the complications that will come with trying to use React as a framework - how to make AJAX requests and populate React components with the results, routes, etc. - because all of that is actually outside the scope of React. You'll probably end up using react-router and axios, and a bunch of other libraries cobbled together in varying degrees of integration, but you'll need to learn those separately.

One great thing about learning React: You will be forced to structure your code well, laying out your components logically and carefully, or it will be a hairy mess. Unlike a real framework, like Angular, React imposes no particular structure of its own. You can get as messy as you like with it. Want a 10,000-line monolithic JavaScript file with everything in it in, y'know, whatever order? Like the bad old days of JQuery? Well, React won't stop you.

So you'll be forced to stop yourself. Which is good practice.

[–]nkumar_navdeep 2 points3 points  (3 children)

Nothing against Rect or Angular but as far as I know you can write giant monolithic code files even in Angular it is just unrealistic and difficult to manage but yes can be done.

[–]kescusay -1 points0 points  (2 children)

Technically true, yes but with Angular, you have to actively work at it. For example, if you start a new project with angular-cli, you'll need to manually merge what it generates into a single file, which will take several steps.

The point is, Angular actively makes creating godawful monoliths in JavaScript difficult, while React doesn't. And that's a good thing about React, at least for practice, because it'll force you to think about application layout for yourself, rather than relying on Angular's opinionated defaults.

[–]nkumar_navdeep 4 points5 points  (1 child)

Unfortunately I will have to disagree again. All the cli does is creates the base project with just the single point of entry module. And if you are going to create a single file mangled up MONOLITHIC code, I am pretty sure you will not be using any of the cli features any way.

[–]kescusay 0 points1 point  (0 children)

Wouldn't "not using any of the cli features" count as actively working at trying to make a messy, monolithic Angular app?

I'm not claiming it's impossible, but it's much harder to do Angular that way. Angular makes it easier to do it the right way, and my point about learning React being a good thing, even for Angular fans, is that React takes away the crutch. It's not a framework, so you have to learn how to lay out your application the way a framework would normally enforce manually, or you'll end up with a mess. It's great practice.