Live data from Hacker News

Why I'm Not a React Native Developer

arielelkin.github.io

181–190 of 318 posts

Re: Why I'm Not a React Native Developer

#181
post #29

Earlier quoted context omitted.

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…

It didn't need to happen in componentDidMount with multiple calls to setState. If it's not getting info that it would only know after mounting, it could have happened in the same line that isConnected is initially defined within the constructor!

  constructor() {
    super()
    this.state = {
      isConnected: Math.floor(Math.random() * 10) > 5
    }
  }

Re: Why I'm Not a React Native Developer

#182

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 fr…

If you are not building large applications then TS is counter productive. Just consider the extra compilation step, the dependencies and obfuscated source code.

While it can be tremendous help, calling it a best practice misses the point.

Re: Why I'm Not a React Native Developer

#183

Could FB plug the cord on React once it does no longer align with its core strategy? Sure, it did it with parse.com without the least concern for the community of users/clients. The apology was to leave behind a half-cooked open source version of parse server. The exact same thing could happen to the React community. I'd say stick to true open source projects and descentralized communities.

Yupp, there's enough precedent with Parse alone.

Re: Why I'm Not a React Native Developer

#184

Earlier quoted context omitted.

> So many big companies with tons of lawyers use React... surely if they do it it's fine. At best, that demonstrates that its fine...if you have lots of lawyers.

...but so many smaller companies and startups use React. Personally all of my employments (five at this point) have used it and none had more than twenty programmers. Has it actually been an issue in real life?

For example: You make something remotely similar to Instagram and it takes off. FB sues you and takes all your reacts and natives from you.

You left with nothing.

Re: Why I'm Not a React Native Developer

#185
post #152
post #145

Earlier quoted context omitted.

If you are considering how to build a native app, reasons why you don't like Javascript are relevant.

You can build RN apps in ClojureScript and, voila: You rarely have to touch JS. Edit (it's not without its flaws though): https://youtu.be/6IYm34nDL64

Did you read the article? Compiling to JS is an issue that is addressed.

Re: Why I'm Not a React Native Developer

#187
post #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 .

>it makes other technologies no longer relevant in this domain

Are you really trying to say that React Native makes Java not relevant for Android and ObjectiveC/Swift not relevant on iOS. Maybe you are correct if you want to build Hello World application, when you will be needing something more optimized sooner or later you'll have to rewrite it in Java/Swift.

Re: Why I'm Not a React Native Developer

#188

Please what kind of programmer would ever do this? if (weAreConnected === true) { this.setState({ isConnected: true }) } else { this.setState({ isConnected: false }) } That is just verbose unnecessarily: this.setState({ isConnected: weAreConnected }); And probably not so popular, but this: var color; if (this.state.isConnected) { color = 'green' } else { color = 'red' } Would be simplified often to: var color = this.…

> what kind of programmer would ever do this?

An enterprise developer.

Re: Why I'm Not a React Native Developer

#189
post #83
post #18

Earlier quoted context omitted.

I believe Xamarin is now free post the MS acquisition with various parts and pieces even becoming open source: https://blog.xamarin.com/xamarin-for-all/

I was actually looking here: https://store.xamarin.com/ Apparently the free version has usage restrictions? I do consider free w/ Visual Studio Pro license not really free. EDIT: The licensing pages are confusing but you're right, my mistake.

No, it's completely free with VS Community (which is also free). And you don't have to pay if your company has 5 or less people working on it. You also have to pay if you have 250+ computers/people employed or your revenue is 1m+/year.

Sounds pretty reasonable to me.

Post reply on HN