17 Matching Annotations
  1. Jun 2020
    1. An Idiom is a low-level pattern specific to a programming language. An idiom describes how to implement particular aspects of components or the relationships between them using the features of the given language.
    2. A Design Pattern provides a scheme for refining the subsystems or components of a software system, or the relationships between them. It describes a commonly recurring structure of communicating components that solves a general design problem within a particular context.
    3. Building blocks are what you use: patterns can tell you how you use them, when, why, and what trade-offs you have to make in doing so.
    4. patterns are considered to be a way of putting building blocks into context
    5. A "pattern" has been defined as: "an idea that has been useful in one practical context and will probably be useful in others"
  2. May 2020
    1. search engines and social networks presence

      More issues with client-side rendered app

    2. the end user is using a slow internet connection, especially mobile connection,the end user is running an underpowered device, for example an older generation mobile device,

      Web applications rendered mostly/fully by JS will become an issue if the target demographic falls into one of these two groups.

    1. functional update form of setState. It lets us specify how the state needs to change without referencing the current state

      For effects that require updating frequent-changing states, use the functional update form of setState to avoid getting into infinite loops.

    2. typically you want to modify refs in event handlers and effects

      Avoid setting refs during rendering

    1. only the assigned variable name addVariable can be used to refer & execute it.

      Named function defined via function expression cannot be called with its name but the variable name it is assigned to, except for the function calling itself.

    2. addFunction overshadows the addVariable in call stack of debugging tools.

      Assigning name to function defined in function expression results in seeing the name shown in the call stack during debugging, instead of the variable name it is assigned to.

    1. a DOM mutation that is visible to the user must fire synchronously before the next paint so that the user does not perceive a visual inconsistency. (The distinction is conceptually similar to passive versus active event listeners.) For these types of effects, React provides one additional Hook called useLayoutEffect

      useLayoutEffect() is the counterpart to useEffect() that is meant for using with the types of work that cannot be deferred. Effects defined using useLayoutEffect get fired synchronously before the next paint.

    2. This makes it suitable for the many common side effects, like setting up subscriptions and event handlers, because most types of work shouldn’t block the browser from updating the screen.

      useEffect() is for using with the types of work that shouldn't block the browser from updating the screen.

    1. Note that a HOC doesn’t modify the input component, nor does it use inheritance to copy its behavior. Rather, a HOC composes the original component by wrapping it in a container component. A HOC is a pure function with zero side-effects.

      The essence of the decorator pattern.

  3. Apr 2018
    1. The takeaway from the article: Choose document-oriented database only when the data can be treated as a self-contained document

    1. The baseline here is detecting technical issues (counting errors, service availability, etc) but it's also worth monitoring business issues (such as detecting a drop in orders).
  4. Dec 2017
    1. The number of transactions the blockchain can process can never exceed that of a single node that is participating in the network.

      Not sure if I understand this correctly. Does this mean the number of transactions that a blockchain-powered network can process is equivalent to the number of transactions that the slowest node in the network can process? If so, I haven't heard such limitation.