Hacker News new | ask | show | jobs
by marcusr 3760 days ago
As a C and then a Ruby on Rails programmer, I never thought I would see the day that my main programming language was Javascript. But I find React such an enabling technology that I made the effort to learn Javascript properly, and am glad that I did.

React itself is allowing me to write web applications faster and with less bugs, primarily because of the unidirectional information flow, but also because of the way it guides you into making everything components, which keeps the borders up between objects and makes testing easy.

Even better, I can now create both iOS apps and Android apps at the same time (I knew Objective C but not Java for Android), and at a much faster speed than before - the flex layout model alone has saved me days and weeks of debugging the iOS layouts in storyboards, and now I'm able to shift code between the app codebase and the web codebase with ease.

It is indeed overwhelming when first trying to learn React, especially when trying to learn Javascript at the same time, and this flowchart is so spot-on with the tendency to start using packagers, boilerplate, redux before understanding why they are useful.

Follow the flowchart, and you will find happiness!

4 comments

I just want to point out that there is no mandate to use a framework in JavaScript. While I'm not familiar with React and I agree that it probably helps developers structure their apps, there is no need to use a framework just to have a component/modular architecture.

One of my favorite examples of clean modular JS that does not depend on a framework is Mozilla's browserquest: https://github.com/mozilla/BrowserQuest/tree/master/client/j...

Many things that make life easier when making relatively small web apps also make debugging more complicated, compared to programming from scratch with minimal reliance on third parties. Choose wisely.

That doesn't work if you're trying to build native mobile apps.
Which is a pity. I would love to see something like Electron for mobile.
I'm pretty sure that's exactly what the Cordova project is: https://cordova.apache.org
Cordova isn't purely native.
Either is Electron.
Can you provide more details about your path to learning JS and React?
What resources did you use to learn Javascript properly? I have been meaning to go through this book: http://eloquentjavascript.net/
> Even better, I can now create both iOS apps and Android apps at the same time

Are you referring to native apps, or do you mean by making a Web app with React you don't need to make native apps?

React Native [0]. Your view-specific code still has to be done per-platform, but your core logic can be shared, and all of it is written with Javascript using React as the framework. The JS creates and controls native elements, with the native parts mostly abstracted away.

[0] https://facebook.github.io/react-native/

Exactly this, made even simpler by the naming scheme that lets you have iOS and Android versions of the same component.
You can write much view code in a way that abstracts over the DOM/Native platform, too, using standard abstraction techniques.
I'm referring to native apps on iOS and Android as the code commonality is huge, with just a small number of platform specific components. The biggest surprise though was how much I could port out for a web version (and Electron based Windows and Mac applications)
His mention of the flex layout model implies React Native