Live data from Hacker News

Why I'm Not a React Native Developer

arielelkin.github.io

31–40 of 318 posts

Re: Why I'm Not a React Native Developer

#31

Ughhh. It's fine if you prefer statically-typed languages to dynamically-typed ones, but that's a preference, not a reason to try and say that JS is objectively terrible. Same with switch fallthrough, same with error handling, same with half his issues with JS. There are some legitimate grievances tucked in there, but the author lost me by pretending that his preferences were universal.

TypeScript is a JavaScript best practice at this point. It's a type safety net on top of dynamic types, so you get the best of both worlds.

TypeScript has a flag that prohibits switch fallthrough, for instance, though that's an easy one to set up a linter to catch.

One reason I prefer NativeScript to React Native; they are embracing TypeScript and Angular vs. React. I find Angular 2 to be more flexible, but that I freely admit is a preference.

Re: Why I'm Not a React Native Developer

#32
post #28
post #21

This is simply a list of things the author doesn't like about JS, very much of which is practically solved by Flow/TS and ESLint. He also makes some of the React examples quite a bit more complicated than they need to be. Declarative UI is very simple! Here's the same code, using both class and functional styles (whichever you prefer), in a much more succinct style (11 LOC vs 49): class Root extends Component { rende…

The point of having isConnected in the state is that it will change depending on OS events. Random is just used as an example

Right, but that would almost certainly be a root-level property in any real app. In any case, it's still awfully verbose and confounding for little reason.

Re: Why I'm Not a React Native Developer

#33
post #29
post #28

Earlier quoted context omitted.

The point of having isConnected in the state is that it will change depending on OS events. Random is just used as an example

Even with state, his code is overly verbose and can be expressed in a much more idiomatic way. var weAreConnected = Math.floor(Math.random() * 10) > 5; if (weAreConnected === true) { this.setState({ isConnected: true }) } else { this.setState({ isConnected: false }) } } turns into var weAreConnected = Math.floor(Math.random() * 10) > 5; this.setState({ isConnected: weAreConnected }); It's almost like he wrote it in t…

Absolutely, especially since he/she wrote it that way in the swift version

    let weAreConnected: Bool = arc4random()%10 > 4
    self.isConnected = weAreConnected

Re: Why I'm Not a React Native Developer

#34
post #10

Unless I'm wrong, the only listed alternatives are both paid and closed source. Xamarin (requires VS Pro) or Appcelerate (requires $480-$1200/year/developer).

Others have mentioned Xamarin is free and (mostly? entirely?) open source now. See also NativeScript [1].

And TypeScript solves 80% of his complaints. A good linter with ruleset hits most of the remaining 20%.

Cross-platform is the way to go in 2016. It's a waste to write in Swift and Java to cover two platforms.

[1] http://nativescript.com/

Re: Why I'm Not a React Native Developer

#35
post #15

Earlier quoted context omitted.

In that case it would probably make more sense to just use NativeScript instead of React Native. https://www.nativescript.org/

NativeScript doesn't have tight integration with React, and I don't really want to build that layer myself.

Angular 2 is pretty awesome and faster than React.

Re: Why I'm Not a React Native Developer

#38
post #11

This is a nit pick, but isn't his "Ambiguous curly braces" example actually breaking due to automatic semicolon insertion? return {{a: 4}} Isn't valid anyways. ESLint easily flags it as an error.

Exactly: Linting rules requiring semicolons should be considered a best practice.

But I think TypeScript should also be considered a best practice, and between the two that would solve pretty much all of his complaints.

Well, that and using "==" to compare to null, vs. "===" to compare to everything else. But the linters all can make that distinction as well.

But he explicitly hates on linters in the article as well. And dismisses TypeScript and Flow ... because his coworkers aren't being forced to use it? THAT is the real problem, I think...

Re: Why I'm Not a React Native Developer

#39
post #20
post #14

Earlier quoted context omitted.

I feel like this is some sort of signaling, a la 'no true programmer uses javascript, because types!'.

We all use it, but 'no true programmer likes javascript.' :)

I must not be a true programmer, then. :/

Re: Why I'm Not a React Native Developer

#40
JavaScript has its share of bad things but that's mostly solved by good tooling. I think Java or ObjectiveC feel too "heavy" for UI development. React makes it simple and even with its downsides in my opinion it makes other technologies no longer relevant in this domain .
Post reply on HN