Journey, React

Day 1: What is React? and Why should I learn it?

If you are like me and starting in your journey as an aspiring web developer, you have probably heard about React and how great it is. “It’s the best thing” and “Everyone should learn it”. But as I’ve tried to learn it this past week, it doesn’t feel like the best thing and I started asking myself, “Do I really have to learn it?”.

react-hype

Well let’s see if it’s more than just a Buzzword, and really know what it is and then decide if we should continue or not. My thoughts on what I found online are in blue italics.

What is React?

I’m not one to learn directly from the  documentation, but if you are then you can find it here. React is a JavaScript library for building user interfaces. What that tells me is that it will work with HTML and CSS to do something different, but what is that something different? What makes react special is that it uses something called components. A component is built separately like a function or a class that renders some output. Most articles, tutorials and other courses go on to talk about the components but I want to know what renders is so looking on and seeing examples I think that renders is a fancy or react’s way of saying it translates the code and displays it in the screen. 

Let’s continue. The developers behind react thought that the component idea was better than what Ember and Angular were doing which as following the MVC pattern. You can read more about that here. MVC’s thing is that the logic should be separate from the View. React is different in that it combines the logic and the view into a component. Well that’s different than what was the norm at that time.

React also uses what’s known as declarative code. Which is different than imperative code. This is actually really new and changes how I think about code. When first learning to program we are told that computers need to be told step by step how to do things. Like a dumb robot. First you push the on switch and wait for it to load. Then you sign in with your user name and password and on on on on. That is imperative code. Declarative code on the other hands is that we tell React what we want and React is in charge of performing all of the JavaScript/DOM and getting us the results. Now there’s a whole new concept of we tell  the robot what we want and it will know how to do it. This is a whole new way of thinking about coding. 

mind blown

I don’t know about you, but I am getting impressed by this. With React, we don’t have to worry about manually manipulating the DOM and trying to figure out all the details on what all the little pieces are and what they should do. It just does it.

React is even known for helping with native mobile apps, virtual reality and even smart TVs. Some big players are using React for this.

I’m sold I understand a bit more about what it is and why I should learn it, I will tough this out and really get into it. Are you with me?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s