Hacker News new | ask | show | jobs
by brandonbloom 4571 days ago
1) I totally disagree about embedding HTML, but it's optional anyway. Cohesion counts. See Pete Hunt's video.

2) React programs tend to be very "dearative" in my eyes. Any declarative language still needs abstraction facilities: ie functions.

3) you can trivially implement any "more declarative" model you want on top of React's stellar core.

4) all of the benefits of test ability from angular apply to react too

Sorry about typos, on phone

1 comments

<tabManager background=blue> <tab closeButton=true> Hello {{propertyName}} </tab> </tabManager>

This is what you typically get at the end in an Angular app. You don't need to "figure out" things where they are and what they are, and what they do in DOM.

Show me this declarative thing in React.

And this is just one part of Angular.

For what its worth,

<tabManager background={'blue'}> <tab closeButton={true}> Hello {this.props.Name} </tab> </tabManager>

Would be valid in react.

Check out http://facebook.github.io/react/#todoExample, specifically the render function.

I think this is pretty easy to understand:

      <div>
        <h3>TODO</h3>
        <TodoList items={this.state.items} />
        <form onSubmit={this.handleSubmit}>
          <input onChange={this.onChange} value={this.state.text} />
          <button>{'Add #' + (this.state.items.length + 1)}</button>
        </form>
      </div>
I don't have any practical experience with angular (but I'd like to, and definitely think its testability is a step in the right direction).

That said, I've found react to be very declarative, especially over the raw jQuery and Backbone I'd used before. Most of the components I write have no state, and render() declares how to render them from any state, without having to worry about how to change things on state changes.