React-ing in the Moment.

So, though the homework doesn’t explicitly instruct us to do so, I thought I’d write about where I’m at with React before reading the assigned material and then write the rest of this post after having read it. In other words I’ve got stuff to say now, and I’d like to say it before I read anything and my words get tainted by (shudder) knowledge.

The crazy thing about this style of learning is how quickly your mind can change about something. On Monday I thought “I’m finally getting a handle on good old fashioned JavaScript and now you’re introducing this crazy new thing that literally changes everything I know.” I genuinely felt like it made things more complicated. I genuinely did not understand its necessity or usefulness. But yesterday our lecture (which is supposed to end at 2) wound up going until 5pm. Our patient and genuinely inspiring teacher stayed with us and worked through a project for 8 straight hours (with a short lunch break). I also think he’s going to read this as part of the homework assignment so this is kind of awkward. We don’t get grades, so this is genuinely not sucking up to the teacher. Maybe I should say something rude about him to even things out. No, but seriously- major points for our teacher yesterday. In working through that project I didn’t have any major “A ha!” moments (essentially the holy grail of Iron Yard- the a ha moment) but the gears started turning. Things began to click. There were no “A ha!’s” but there were a WHOLE bunch of “ohhhhhh’s”. Does that make sense to anyone but me? Probably not. Oh well. At any rate, yesterday was the first time I felt like React was the next logical step from what a fellow student referred to as “Vanilla JavaScript” (aka a flavor at the lamest Baskin Robbins). I realized, oh, maybe this place does have a method to their madness. Which reduced my madness. A little. Okay, onward to the reading material! Back soon.

Hi again. What’d I miss? I hope while I was gone you treated yourself to an episode of “Mr. Robot” (new episode tonight!) or perhaps took in a film from Hulu’s comprehensive Criterion Collection. No? That’s Okay. I actually kind of feel like Elliot from Mr. Robot. He talks to the audience (basically his imaginary friend- in fact the first episode is called .he110Friend). And I’m talking to hypothetical imaginary readers. All I can say is I hope my father is real. I’m not saying any more than that in case you haven’t watched yet, hypothetical imaginary reader.

So. Speaking of Reading. Damn it. We spent many of the above described hours working on creating a To-Do List with React and we spent a significant amount of that time working on building an add “To Do” items function to the List. And there was the code, right in the first article. Oops. It’s not the sexiest looking thing in the world, but I don’t think there’s any CSS linked to it, I think it’s just straight React JSX code. Ready for the crazy part? I freaking understood the code. Props to Matt! (Yes, that was a React pun. What is happening to me). The first article very clearly articulated a response to my initial query in this post which was “Why use React?”. To me, the answer is simple and very Vulcan- it’s logical. React lets you create more complex and interactive UI’s with code that is easier to read and comprehend, easier to organize, takes less of the million “Vanilla” commands (document.queryselector, addEventListener, etc), and lets you use outside components. It’s kind of funny, and definitely speaks to what I said above about this style of action-packed “learn a year of material in 12-weeks” style of learning- on Monday React was ridiculous and unnecessary. On Tuesday React was just another freakin’ thing to add to the pile of things I didn’t understand JUST as I was starting to get a firm grasp on JavaScript. Then on Wednesday React was the OBVIOUS next step. And obviously we need to learn regular JS before it. Man, it feels great to understand things huh? Like, really great.

The articles about JSX were interesting and offered a lot of insight but nothing really worth writing publicly about. You’re more than welcome to see my notes. Good luck reading them though. I swear I once knew how to write by hand and not have it look like I was being shook (shaken?) by Jessica Jones as I wrote them. (Question: They use “var” in their examples. Is that because these are older articles? Or are those appropriate places to use var? I’ll investigate.) It’s going to take me a few days to fully comprehend some of the terms, particularly the notion of a “spread”. I also struggled a bit with the last article, particularly with comprehending synthetic event systems. That speaks to what I wrote in my first post about my comprehension lag. As promised (you know, for those of you out there waiting with baited breath) my next post is going to be about trying to come to terms with that lag and hopefully, with time, reducing it. I think I’d like to have that be part of a post about “trusting the process”, another concept that gets used a lot at Iron Yard.

Instead, I want to talk about the second article. It freaked me out a little because I think my computer is bugged and it heard me say “Why React?!” because, well, the article is named “Why React?”. So there’s that. To answer my own question by way of these articles, I think one ought to use React because, once you can comprehend the code structure, it is genuinely more intuitive than what we’ve learned so far. The fact that I’m looking at chunks of code and am able to read them almost as if they’re telling a story is a major thing. I can tell you with certainty that I still can’t totally do that with regular JavaScript. I opened up an older project (A Tic-Tac-Toe game) and looked at the JS code and there is SO MUCH of it, all bunched together, with a million different variables and functions and defined values. I genuinely believe React simplifies everything. I hope I’m on the right track with that belief. It will no doubt get more complex (we are only a third of the way through the program) but I when I do let myself kind of “surrender” to the process I truly believe that this stuff won’t always go over my head. Hell, it already isn’t and I’m brand new to this entire world. The fact that I was even able to read those articles without having to consistently wiki the different terms that were used is not something I could have done July 18th.

So- why React? At this point I think what I really want to do here is straight up quote their answer because it perfectly describes the journey I just discussed: “React challenges a lot of conventional wisdom, and at first glance some of the ideas may seem crazy. Give it five minutes while reading this guide; those crazy ideas have worked for building thousands of components both inside and outside of Facebook and Instagram.” I’m honestly beginning to feel like coders talk like me. Or at least think like me. Which, if we’re taking logical leaps here, may mean- wait for it- that I could be a coder. It’s hard to express via a blog how much joy it brings me to be able to type that and mean it.