ReactJS and the Encircling Darkness

Here we are, another day lost forever to the sands of time at the hands of ReactJS. Each day that melts off the calendar we drift further and further from safe harbors and deeper and deeper and deeper into the endless abyss. Will this journey ever conclude? Will we ever reach the land of milk and honey or are we cursed to be tossed about in the tempest to the taunts of the hourglass? In these moments the will becomes weak, the mind begins to wander. To ask the questions and peer into the darker corners of conciseness we would rather not acknowledge.

Have we made a huge mistake? What are we even doing here? Is the juice worth the squeeze? We felt confident and on course but a few short weeks ago. It felt like a different world then, filled with light and promise. The light was a false idol, a trick played by that which wishes to do us great harm. A perfectly laid trap of hubris for the overconfident.

The world we find ourselves in today is a much darker place. The darkness creeps and becomes all enveloping. Struggling, we search desperately to find the pinhole of light that may act as our guide to a better space. Grasping at lifelines we futilely thrash about, the braided rope slipping through our callused, weary grasp.

ReactJS is not a merciful creature. The process will be drawn out. Each blow felt deeply in our core. It rattles the mind. There is no way around this. In our less proud moments we pray death comes swiftly. For the struggle to conclude.  It would be so easy to surrender, to lay down and allow the darkness to wash over.

In these, the darkest hours, we discover who we really are. The veils we wear, the people we pretend to be are of no use here. The choices are put plainly before us. To give in to the overwhelming feelings of doubt and despair, to let the darkness in, or to instead lean into the challenge, to fight back and rebuke the encroaching darkness. To press on, into the unforgiving maw.

To submit is death, so we must press on. We must, we must, we must at all costs march forward. For on the other side there is light, there is vindication. Victory. It will not be easy. The cost will be high. There are no alternatives. We must press on, we must never give in, we must never surrender.

ReactJS Is Facebook Sorcery

ReactJS. Where do I even begin? From 10,000ft it appears to make sense and seems relatively simple. The issues pop up when you dive in for a little closer of a look. It’s some strange amalgamation of JavaScript, HTML and something called JSX  dreamed up by the wizards at Facebook that is only slightly more sensical than the ramblings of a homeless person on an angel dust bender. It somehow allows for the use of HTML tags outside of a .html file, which up until about three days ago I didn’t think was possible. And yet here we are.

The big picture makes some sense. It allows for re-rendering of only the parts of the page that have changed. (Yay for conserving resources!) This is accomplished by writing the code in a modular style which has the knock on effects of making the main program more readable and makes the chunks of code easily reusable.

Seems simple enough right? Well it’s not. It’s really, really not.

The nuts and bolts of it appear pretty straightforward, we start by creating a COMPONENT directory and then create individual files within the aforementioned COMPONENT. Within those individual files we write our code which can execute whatever tasks our feeble little minds can dream up and write. So far, so good. The individual components of React can be defined either with a standard, everyday JS function or with an ES6 class.

This is where things start getting slippery. The ES6 class is the preferred method for defining React components because we can access ‘this’ and lifecycle methods. The ‘this’ method simply refers back to whatever scope we’re in. Pretty standard JavaScript stuff in 2018. What is a lifecycle method? I have no idea. I think it has something to do with the tides or whether Mercury is in retrograde or something? Scott Domes over at Musefind describes the lifecycle as “the life of a React component, from birth (pre-mounting) and death (unmounting)“. Which is…not super helpful since I don’t know what pre-mounting or unmounting are. I’m pretty confident in saying they are opposite sides of the same coin but beyond that I got nothing. (Also I think that it should probably be “from birth to death” but whatever, I’ve got way bigger fish to fry than Scott’s grammar.) Luckily we have this handy graphic:

….which helps our understanding? I guess? I mean I know what some of those words mean so thats a pretty good. Right? Right?! RIGHT?!!?!?!!?!

I don’t know what kind of hippy, communist witchcraft Facebook is trying to push on all of us good, wholesome, God-fearing, capitalism loving web developers with this devil ReactJS but I don’t like it.