Skip to main content

Posts

Showing posts from November, 2017

ReactJS - JSX

How are websites formatted? Mentioned briefly in prior entries, websites are generally formatted with HTML, a markup language to specify how text is divided up, organized, and displayed (CSS is also used, which gives the different divisions of the webpage styles to make it look presentable, but that is out of scope for the discussion). Well, with ReactJS, they have an interestingly similar approach to writing dynamic site markup; JSX. Courtesy of kode-blog.com [3] What is JSX? JSX, standing for JavaScript XML , is a syntax extension of JavaScript developed specifically by the team to allow "React Elements" as legitimate data types. These React elements consist of XML markup that are used in organization. Wait a second; what is XML even? Have we discussed it yet? To be honest, XML has thus far not exactly been brought up. However, XML is very similar to HTML (the previously discussed markup language) both in appearance and (to a lesser extent in the general sen...

ReactJS - Immutability

Value vs. Reference Equality The mutation of data in computer science is something everybody who has studied a common programming language has done at some point. You create a variable and they you change it ! Magic! All of a sudden, you have a variable that is completely different, with a different value and everything! Well, actually, there's something that probably didn't change; the location of the data in memory. The variable is still pointing to the same place it always did; a little section it found specifically for the variable. The contents of the section had changed, but the reference - a sort of ID, if you would - is still the same. This is called mutating the value, and can therefore be seen as mutability. ReactJS's Spin ReactJS has an interesting method of making rendering more efficient, and it involves the way you alter data. Instead of changing the values of a set object every time you need it to change (mutating it), you can actually adopt a st...

ReactJS - Reactive Programming

What Is Reactive Programming? Reactive programming is a commonly-implemented practice in React implementations, but what does that actually mean? Well, Wikipedia's got our backs with the most basic of definitions: "In computing, reactive programming is an asynchronous programming paradigm concerned with data streams and the propagation of change." Who did what now? Yeah, it seems complicated, but not only is it necessary but, with the veil of jargon explained, it's actually pretty basic. Courtesy of innoq.com [10] Reactive Programming Fundamentals Complexities aside, you can think of reactive programming as programming with changing information. In basic Java programming, for example, int c = a + b; assigns c that sum of the two variables at the time of assignment , not a binding obligation to continuously reflect the sum of a and b as they change. With reactive programming, when a variable's value changes, values associated with said value als...