为什么解释器模式很糟糕?

时间:2022-05-07 20:46:54

In Steve Yegge's review of Design Patterns, he calls the Interpreter Pattern an "in-joke". He goes on to talk about how the perception of compilers have changed, yet how interpreted languages are still s*** on, although I can't see how this ties into the pattern.

在Steve Yegge对设计模式的评论中,他将解释器模式称为“开玩笑”。他继续谈论编译器的看法是如何改变的,但是如何解释语言仍然存在,尽管我看不出它是如何与这种模式联系起来的。

Anyone want to enlighten this ignorant student?

有谁想要启发这个无知的学生?

3 个解决方案

#1


That was irony :) Everybody loves interpreted languages nowadays but 10 years earlier people just thought they are too slow for anything practical. Much like today most of people thinks about static vs. dynamic typing.

这很讽刺:)现在每个人都喜欢解释性语言,但10年前人们只是认为它们对于任何实际的东西都太慢了。就像今天一样,大多数人都会考虑静态与动态类型。

#2


The INTERPRETER pattern sucks because it's a codification of Greenspun's tenth rule:

INTERPRETER模式很糟糕,因为它是Greenspun第十条规则的编纂:

Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.

任何足够复杂的C或Fortran程序都包含一个特殊的,非正式指定的,错误缠身的,一半Common Lisp的缓慢实现。

This was stated in 1993. A modern addendum might include C++ and Java.

这是在1993年提出的。现代的附录可能包括C ++和Java。

#3


He loves it according to this: http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html.

他喜欢它:http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html。

#1


That was irony :) Everybody loves interpreted languages nowadays but 10 years earlier people just thought they are too slow for anything practical. Much like today most of people thinks about static vs. dynamic typing.

这很讽刺:)现在每个人都喜欢解释性语言,但10年前人们只是认为它们对于任何实际的东西都太慢了。就像今天一样,大多数人都会考虑静态与动态类型。

#2


The INTERPRETER pattern sucks because it's a codification of Greenspun's tenth rule:

INTERPRETER模式很糟糕,因为它是Greenspun第十条规则的编纂:

Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.

任何足够复杂的C或Fortran程序都包含一个特殊的,非正式指定的,错误缠身的,一半Common Lisp的缓慢实现。

This was stated in 1993. A modern addendum might include C++ and Java.

这是在1993年提出的。现代的附录可能包括C ++和Java。

#3


He loves it according to this: http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html.

他喜欢它:http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html。