avatar

Coderek's blog

Live a more efficient life
Archived Posts for year 2022

React's useContext is an implicit way to do dependency injection. Components which use values from a context implicitly declare its usage of the context provider. The context provider is acted as an …

Read more ››

Dependency injection is a simple idea: Put depended instance objects in the constructor parameter list of a class, so that when constructing the class object, the dependency can be easily swapped f…

Read more ››

何谓真理

真理,字面上的解释是“真正的” “道理”。 “道理”我们知道,可以是道德的理由,或者广泛一点“解释某种事物的逻辑因果关系的理论”。(我一直以来在追求这样一种通用的理论) 那么什么是“真正的”呢?也可以反过来说,什么是假的呢?真真假假,假假真真。 打个比方,”太阳今天早上从东边升起来了“ 这句话一听就知道是真的。为什么呢?我们的大脑是通过怎样的一个过程来判断这句话是真的呢? 有可能有这三种思考过程…

Read more ››

从之前的思考中我得到了一条道理。 Live a more efficient life. 过一个更高效的人生。 这里主要就是一个词,efficient,效率。 为什么这么说呢? 首先,效率,就是在一定时间内完成更事情。 我认为,人从出生开始就是一个对周围事物充满好奇的动物。 大多数人的一生就是在不断的体验生活。 对,就是体验。比如在我们还未成年的时候,我们的生活已经被安排好了。 上幼儿园,小…

Read more ››

最近再次拜读《明朝那些事》,对王守仁的描述有了新的理解。其实也算不上新的理解,因为上次读根本就没有什么理解。这次阅读终于读懂了为什么王守仁的心学是那么的有意义了。

Read more ››

I've been thinking this a lot recently. React is just a view library. What it means is that you give it some data, you'll get some UI. Just think of it as a math function of view. Given the same ro…

Read more ››