James Tsang

James Tsang

A developer.
github
twitter
tg_channel

ARTS Check-in Day 1

A: 617. Merge Two Binary Trees

The algorithm foundation is relatively weak, it took many attempts to pass~

R: Things you forgot (or never knew) because of React

  • Due to its early release, React has gained certain advantages and become the standard, but it also has some serious shortcomings in terms of agility and adaptability. Since 2013, every decision made by React has added another layer of technical debt, while its competitors do not have these limitations.
  • Regarding the issue of the ecosystem: we have been "trained" to think that packages are specific to frameworks, and React has accelerated this viewpoint. We tend to find React packages for everything we do, rather than native JS packages. As a result, React's rules, state management, component lifecycle, and other aspects are brought in, which may not work well or be convenient with incompatible frameworks. However, it shouldn't be like this. Everything is just JS, so anything related to JS should be included. (Of course, this is also true for frameworks like Svelte and Vue, but React is the heaviest in this regard. Other frameworks have stronger adaptability and do not have issues like rendering lifecycle. The common choice of these frameworks is the use of web components). Preact's Signal is an example. Although it is used for itself, it can also be used in any other framework or even native JS. The same applies to Web Components, which are compatible with any non-React framework.
  • React Hooks are outdated: Hooks are no longer an advantage, they are the baseline and the conventional way. Other frameworks have similar things, but they are faster, easier to use, and write.
  • You no longer need to manage rendering at a fine-grained level: for example, the difference between useMemo and useCallback, the understanding of dependencies and lifecycle in useEffect. You don't need to worry about these in other frameworks. They are smarter and only update values instead of continuously updating things that don't need to be updated.
  • Dealing with large-scale complex applications is no longer a necessary focus: React is not the best, only, or even the first solution for large-scale complex applications in the frontend. It is just one of the many possible versions of the same paradigm, and it is an old version. Other modern competing frameworks can also handle this problem.
  • Server-side rendering is no longer special: except for React, most players also support server-side rendering.
  • Two-way data binding is not difficult or bad: React has a one-way data flow, so using forms is cumbersome. Two-way data flow doesn't have these problems, and some of the problems caused by two-way data flow have also been solved through long-term iterations.
  • Handling styles is simple: React does not have a built-in elegant solution for styles, but in Vue and Svelte, this problem has been solved internally. They both have component-level scope, and the solutions that can be used in React are also compatible with them.
  • Learning frameworks is no longer so difficult: React's state management, props, nesting, lifecycle, hooks, JSX, etc. are not very friendly to learn. The new frameworks now are much easier to learn.
  • The author highly recommends Svelte and Vue, two compile-time frameworks.

T: CodeBox

An isolated Python sandbox runtime environment that can be used to implement ChatGPT Code Interpreter.

S: Memories of reading "The Highest Learning Method"

It is best to control the ratio of output to input time at 70% to 30%. Output is the "effective" way of learning, just input without output is equivalent to not learning, and it is also difficult to remember.


Reference:

  1. ARTS Check-in Activity
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.