News for hackers. Stuff that matters.
Re:Angular 2 Fundamentals Course by taesu on Friday July 29, 2016 @11:58AM (#12187697)
I heard angular is a framework and react is lib. angular 2 or react. Coming from nodejs, python, php, jquery experience which should I learn?
Re:Angular 2 Fundamentals Course by skrowl on Friday July 29, 2016 @12:03PM (#12187753)
Angular is a more full featured than React by itself. To get React to equivalent features you have to add on (and learn) several other things (Redux, WebPack, etc, etc). As a bonus, there are lots of different conflicting flavors-of-the-week for things to use with React to build out your stack, so whichever you pick to go with React might not be cool next week.
Re:Angular 2 Fundamentals Course by whatever_dude on Friday July 29, 2016 @12:17PM (#12187856)
This. In the end both work similarly, but with React you have to shop around to decide what to use. With Angular things are a bit more strict and directed.
Re:Angular 2 Fundamentals Course by hugozap on Friday July 29, 2016 @12:35PM (#12187961)
This is not accurate. You don't need to learn Redux or WebPack to use React. With Angular you also need a build process so you can use gulp or WebPack. Maybe there's a pre baked process but you still need to know some build tool.

Because React doesn't care about how you manage your state, you can use Redux or other solutions. Not because they are cool , but because it fits your needs.

Re:Angular 2 Fundamentals Course by pauljaworski on Friday July 29, 2016 @01:09PM (#12188209)
> To get React to equivalent features

That's the key part you ignored in your response.

Re:Angular 2 Fundamentals Course by komali2 on Friday July 29, 2016 @02:43PM (#12188956)
Why does Angular need a build process? You can just point script tags at a fat angular.js file, or a CDN, and go on your merry way.

Sure it's not like the 10x dev way to do it, but I do it for simple apps all the time.

Re:Angular 2 Fundamentals Course by hugozap on Friday July 29, 2016 @04:45PM (#12189844)
Same thing with React.
Re:Angular 2 Fundamentals Course by RussianCow on Friday July 29, 2016 @01:10PM (#12188224)
I think the overall point that you have to fill in the gaps yourself still stands, though. Angular just comes with way more features than React does, so if you want an equivalent experience, you have to use third-party libraries with React, which increases the amount of things you have to learn. Not that this is entirely a bad thing, but you can't really compare bare React to bare Angular and say they're equivalent.
Re:Angular 2 Fundamentals Course by hugozap on Friday July 29, 2016 @04:43PM (#12189835)
Not sure if your point about the amount of things to learn is true. I prefer learning small utilities and compose them. The cognitive load is much more smaller (for me) than having to learn a giant monolith. I guess it's a matter of preference.
Re:Angular 2 Fundamentals Course by RussianCow on Friday July 29, 2016 @04:52PM (#12189891)
There are tradeoffs. The advantage of learning smaller libraries is that you only have to learn what you need. However, the advantage of a monolithic framework is that everything is integrated so nicely that, once you learn the framework, everything kind of "just works", and you don't have to spend time figuring out how to glue everything together. I personally prefer the former approach, but I also understand the appeal of a framework like Angular or Ember that makes all the high-level decisions for you.
Re:Angular 2 Fundamentals Course by erokar on Friday July 29, 2016 @01:33PM (#12188398)
With Angular you get all you need out of the box. Easy to get going with ng-cli (creating an app, generating components etc.). Typescript is default, so you get type safety if you want it. I like a lot of what I see.

Conceptually, React and Angular are quite close. In both you build an app with components nested in a three structure. Angular let's you do two-way binding if you want — convenient, but makes state changes less explicit.

React is closer to bare bones JS and HTML. Templating in HTML only consists of a simple way to embed JS code and a few reserved keywords. In Angular, templating is much more elaborate, and therefore more complex and takes a longer time to learn.

React — both by design and community — favours FP priciples, while Angular is mor OOP oriented, though neither is strictly one or the other.

Personally I like both. React for its simplicity, Angular for its all-batteries-included approach and support for static typing as default.

Re:Angular 2 Fundamentals Course by HillRat on Friday July 29, 2016 @01:14PM (#12188248)
My experience is that Angular 2 is a great solution for enterprise-style shops who are looking for an all-in framework. With React, you benefit from greater flexibility outside the view layer, but ... well, you also suffer from greater flexibility outside the view layer.

In general, I'd say that the more comfortable you are with current FEAD practices and toolchains, the more power you'll get out of a React-based architecture. The more you want something that "just works" and has already made many architectural decisions for you, give ng2 a shot.

Re:Angular 2 Fundamentals Course by datihein on Friday July 29, 2016 @01:24PM (#12188325)
What does "FEAD" mean?
Re:Angular 2 Fundamentals Course by PureSin on Friday July 29, 2016 @01:46PM (#12188489)
Guessing its Front End Application Development
Re:Angular 2 Fundamentals Course by aikah on Friday July 29, 2016 @12:23PM (#12187884)
What should you learn? both. But you should also be able to write "rich" single page applications without a framework and understand basic DOM manipulation.
Re:Angular 2 Fundamentals Course by ken47 on Friday July 29, 2016 @01:25PM (#12188333)
Having used and studied both React and Angular2, Angular2 can do certain things that React can't. Two features at the forefront of this difference are:

1) Dependency injection

2) Direct support for using observables and promises in templates

However, I cannot think of anything major in the reverse direction.

There is also the fact that it is designed to be used with Typescript from the get-go, which can be a plus if type safety is your thing.

Re:Angular 2 Fundamentals Course by Chyzwar on Friday July 29, 2016 @07:25PM (#12190802)
You can inject stuff using props. DI is not unknown concept in react, note that angular1.x do not have true dependency injection.

React decouple data and view. You can achieve similar behaviour but using flux/redux to publish/subscribe.

Re:Angular 2 Fundamentals Course by savanaly on Friday July 29, 2016 @12:08PM (#12187781)
Angular for job opportunities, react for more pleasant and forward looking web development practices.
Re:Angular 2 Fundamentals Course by devuo on Friday July 29, 2016 @01:07PM (#12188192)
Er.. https://github.com/angular/angular-cli

1. Open terminal

2.

> npm install -g angular-cli

> ng new app

> ng serve

4. Use the cli tool to generate components/pipes/services/etc., build, test, develop

5. Profit.

Find a more blissful and joyful experience than this in react land?

Re:Angular 2 Fundamentals Course by slmyers on Friday July 29, 2016 @03:00PM (#12189085)
Well, react did come up with this https://facebook.github.io/react/blog/2016/07/22/create-apps... recently.

Also, one thing that is not enjoyable/straightforward with(angular-cli) is having to utilize System.js in order to include 3rd party libraries in your app.

Re:Angular 2 Fundamentals Course by Bahamut on Friday July 29, 2016 @05:30PM (#12190175)
That is about to change to webpack on next release - a big PR landed in the angular cli to switch it to webpack from broccoli.
Re:Angular 2 Fundamentals Course by savanaly on Sunday July 31, 2016 @02:16PM (#12198094)
The number of steps it takes to get it "up and running" is relevant, but hardly the most important part of what makes a language/framework a pleasant experience. Also, you seem to assume I'm in react land? But I'm an angular developer. I know first hand the big problems of angular :P
Re:Angular 2 Fundamentals Course by andys627 on Friday July 29, 2016 @02:06PM (#12188649)
Maybe, but it will take you 3 weeks to set it up.
Re:Angular 2 Fundamentals Course by specialp on Friday July 29, 2016 @02:09PM (#12188677)
This:

  git clone https://github.com/Day8/re-frame-template
  lein new re-frame <project-name>
  lein figwheel
Program with a great functional language (Clojure) and watch magic happen when Figwheel dynamically reloads all of your changes in your browser...
Re:Angular 2 Fundamentals Course by kimshibal on Friday July 29, 2016 @12:03PM (#12187747)
Ignore both. Learn vue.js to get shit done.
Re:Angular 2 Fundamentals Course by ausjke on Friday July 29, 2016 @01:09PM (#12188211)
Wordpress goes with react, drupal picks angular2, and laravel favors vuejs.

This is no surprise, wordpress is extremely popular these days for all users, a huge angular2 client framework might be an overkill for many of its users. Drupal on the other hand is doing the more complicated websites, and its "ordinary" user base is shrinking, so angular2 might attract enterprise users.

Laravel is arguably the most popular PHP framework today, choosing vuejs as its client framework gave vuejs a strong boost for sure.

Re:Angular 2 Fundamentals Course by theprotocol on Friday July 29, 2016 @01:58PM (#12188592)
Agreed, Vue.js and Riot.js are both brilliant for actually getting things done without having to read a 100 page manual.

As for Vue vs Riot, it's subjective, but I'm personally partial to Riot due to its simplicity (albeit with a smaller feature list) and focus on components without being opinionated at all (not even regarding the toolchain).

Re:Angular 2 Fundamentals Course by sdegutis on Friday July 29, 2016 @12:05PM (#12187764)
That doesn't address the issues the comment just above you (at time of writing) brings up, namely that even with Vue you still need to set up all the tool chain around it, whereas Angular brings a lot of that to the table for you.
Re:Angular 2 Fundamentals Course by kimshibal on Friday July 29, 2016 @12:12PM (#12187803)
I handle a big React app at my job. It's messy as fuck with JSX. We made a transition to Vue. Couldn't be happier.
Re:Angular 2 Fundamentals Course by hugozap on Friday July 29, 2016 @12:26PM (#12187896)
What in particular about JSX makes it messy compared to vue? Messy template code can happen in both.
Re:Angular 2 Fundamentals Course by clivestaples on Friday July 29, 2016 @12:39PM (#12187998)
Vue templates support conditional rendering (v-if/v-show/v-else) which I didn't realize I missed until using them. Also, conventions around component data are really nice and help keep markup tidy and very readable.

I like to think of Vue as React with sensible conventions. That said, both are terrific and solve UI problems very elegantly.

Re:Angular 2 Fundamentals Course by troncheadle on Friday July 29, 2016 @01:07PM (#12188200)
React handles conditional rendering better imo. You use regular JS instead of having to learn a new API. You can use control logic in your render methods to great effect.
Re:Angular 2 Fundamentals Course by clivestaples on Friday July 29, 2016 @01:17PM (#12188275)
I definitely agree that React is clean for the reasons you state and I always enjoy building UIs with it. I suppose my comment was just a reflection on the differences that I found refreshing - to my surprise.
Re:Angular 2 Fundamentals Course by sotojuan on Friday July 29, 2016 @12:52PM (#12188099)
So it's your engineer's fault. Plenty of companies get stuff done with React everyday.
Re:Angular 2 Fundamentals Course by huskyr on Friday July 29, 2016 @12:30PM (#12187935)
If you want, you can use Vue.js just like jQuery. Pop it in a <script> tag and you're done. No tool chain needed. I do that all the time for small-medium sized projects and it works absolutely fine.
Re:Angular 2 Fundamentals Course by woofyman on Friday July 29, 2016 @12:15PM (#12187835)
Learn both then decide for yourself which one you like better.
Re:Angular 2 Fundamentals Course by taesu on Friday July 29, 2016 @12:07PM (#12187775)
I don't have time to learn both. TBH, I am forcing myself to learn cuz... all these examples I could accomplish with jquery...
Re:Angular 2 Fundamentals Course by ebeal on Friday July 29, 2016 @01:26PM (#12188348)
You could get the end result of a lot of these smaller example applications with jquery but making anything bigger is going to get very unmanageable very quickly. Also considering how close angular 2 is to react I'd be surprised if by learning one you wouldn't be able to at least understand code in the other. I guess it really depends what your end goal is.
Re:Angular 2 Fundamentals Course by hathym on Friday July 29, 2016 @12:01PM (#12187734)
+1 for react
Re:Angular 2 Fundamentals Course by softinio on Friday July 29, 2016 @12:01PM (#12187735)
Both :-)