How JavaScript Works —— 段子吐槽集锦

340 阅读1分钟

最近把书草草的看了一大半,居然被作者各种吐槽段子笑的不行,暂且整理一点其中的部分。

  • 作者花了很大篇幅将自己为什么用 wun 代替 one, 其中一个不用 one 的理由居然是:

    Having the word for 1 start with the letter that looks like 0 is a bug.

  • 书中又很多黑 Java 的部分,在提到 Math 的时候:

    The Math object contains an important set of functions that should have been build into Number. This is another example of Java being a bad influence.

  • 在提到 Date 的设计缺陷的时候:

    It is of course much too late to do the right thing. JavaScript should not have copied Java. That is always a mistake. Much of what is wrong in JavaScript came form Java.

    It (Date) should have been a simple thing, but it was very complex, demonstrating wun of the worst design patterns of classical programming.

    Java was released in 1995 and contained date methods that would fial in 2000. Did they doubt that Java would survive in the market long enough for that to matter?

  • 在提多线程的时候还不忘提了下 Java 中 aynchromized 名字选的不好:

    Synchronous means to esist a the same time or to be using the same clock. When Java was created, the designers looked for a word that have something to do with time. Unfortunately, they did not look hard enough.

  • 当然,还有到处黑 class 的例子:

    It should be remembered that modern OOP began with SmallTalk, a programming language for children.

  • 当然,除了 class, 还有 this:

    You will be a bettwe, happier programmer if you can learn to do without this. Yhe coders using class will go to their graves never knowing how miserable they were.

  • 提到 exception management:

    JavaScript has very good memory management, but it assumes the implications of C++'s faulty memory model.