Text File Disk IO
- Java (Guava Files.asCharSource.read()): 727 ms, 45.7 MB, Throughput: 62.9 MB/s
- Python (f.read()): 200 ms, 45.7 MB, Throughput: 228.5 MB/s
A function can be legidmitly called without giving required arguments.
The building block of a react app is react element (which is a html element with JSX sytax embedded). React element can be generated by expanding react component (which is a collection of react elements).
React component take the form of either ES6 function or ES6 class. React elements or smaller react components should be returned by the parent component when implemented as a ES6 function. When implemented as a ES6 class, react elements or smaller react components should be provided in the render() method definition (via "return" keyword).
React components accepts props as the container to pass data down through the component chain.
In react, an event is defined as a function and passed as inline HTML event property: "onClick=function" using JSX syntax.
"state" can be updated via setState function. This function assign a new object to the state of a component. "setState" function accepts a annonymous function rather than a property assignment.
State and preState are predefined react properties.
React.Component has setState method
In react, a render(return()) mehthod can only accepts a
In react, inline css style should be put into an object definition rather than string. The naming convention is camel case.
The local state of a component can only be assigned directly when initialization (in the constructor). Otherwise the only way to revise it is through setState method.