How would someone who really knows how to take advantage of dynamic programming languages approach programming differently than someone working in a static language?
真正懂得如何利用动态编程语言的人如何以不同于使用静态语言工作的人来编程?
I'm familiar with the whole debate over static versus dynamic typing, but that's not what I'm getting at. I'd like to discuss problem solving techniques that are practical in dynamic languages but not in static languages.
我对静态与动态类型的整个争论很熟悉,但这不是我所得到的。我想讨论在动态语言中实用但在静态语言中不实用的问题解决技术。
Most of the code I've seen written in dynamic programming languages isn't very different than code written in static programming languages. As the saying goes, you can write FORTRAN in any language, and many people do. But some people use dynamic programming languages to solve problems in a way that wouldn't easily translate into, for example, C++. What are some of their techniques?
我在动态编程语言中编写的大多数代码与用静态编程语言编写的代码差别不大。俗话说,你可以用任何语言写FORTRAN,很多人都这样写。但是有些人使用动态编程语言来解决问题,这种方式不容易转化为例如C ++。他们的一些技术是什么?
What are some good resources that discuss how to use dynamic programming languages? Not books on language syntax or API reference, but resources on problem solving approaches that take advantage of dynamic language capabilities.
讨论如何使用动态编程语言的一些好资源是什么?不是关于语言语法或API参考的书籍,而是关于利用动态语言功能的问题解决方法的资源。
EDIT (1/5/2009): I appreciate the answers below, but they don't seem to account for the huge increases in productivity that dynamic language advocates say they experience.
编辑(2009年1月5日):我很欣赏下面的答案,但它们似乎并没有说明动态语言倡导者所说的他们所经历的生产力的巨大提升。
15 个解决方案
#1
I like slim's answer. I do spend a crazy amount of time in Java and C++ crafting custom data structures that are just free in Python/Ruby. And crafting specialized functions to process these custom data structures. Yes, in C++, STL is really nice. Yes, Generics in Java are nice. They help create custom data structures much faster, however they still require a lot of thought and consideration.
我喜欢苗条的回答。我在Java和C ++中花费了大量的时间来制作Python / Ruby中免费的自定义数据结构。并制作专门的函数来处理这些自定义数据结构。是的,在C ++中,STL非常好。是的,Java中的泛型很好。它们有助于更快地创建自定义数据结构,但仍需要大量的思考和考虑。
However, there is a more fundamental reason why dynamic languages are easier to work with. It is a deep idea which is called duck typing. Some comments above refer to duck typing, but please take time to reflect on what duck typing is. It is a fundamentally different way to view the world. A view that is incompatible with languages like Java and C++.
但是,动态语言更容易使用有一个更基本的原因。这是一个深刻的想法,叫做鸭子打字。上面的一些评论涉及鸭子打字,但请花时间思考鸭子打字是什么。这是一种观察世界的根本不同的方式。与Java和C ++等语言不兼容的视图。
Duck typing means that you waste not time in defining what a duck is. By not having to formally define your objects you save a lot of time and energy. Getting definitions right is hard. Have a look at this blog post of mine where I give examples: Formal definitions are less useful than you think
鸭子打字意味着你不会浪费时间来定义鸭子是什么。通过不必正式定义对象,您可以节省大量时间和精力。正确定义很难。看一下我的博客文章,我举例说明:正式定义没有你想象的那么有用
Duck typing has proven extremely useful. The "Must Ignore" principle in XML is what has made XML so significant and useful on the web. But that's just an instance of duck typing.
鸭子打字已证明非常有用。 XML中的“必须忽略”原则使XML在Web上如此重要和有用。但那只是鸭子打字的一个例子。
Another way to express duck typing is by the Web mantra "Be strict in what you send, generous in what you accept". That is also a very fundamental idea.
表达鸭子打字的另一种方式是通过网络口头禅“严格按照你发送的内容,慷慨接受你所接受的”。这也是一个非常基本的想法。
Finally, you may want to back to a long blog post of mine where I explain duck typing and how it relates to things like AI and modelling: Duck Typing, Artificial Intelligence and Philosophy
最后,你可能想回到我的一篇长篇博文,在那里我解释鸭子打字以及它与人工智能和建模之类的关系:鸭子打字,人工智能和哲学
#2
One way I typically find myself taking advantage of dynamic programming languages is in simplifying and clarifying syntax. If I'm representing a database, for example, the syntax I use for interacting with it can be much cleaner if I can dynamically load properties and methods on the database object for its tables, the tables and rows for their columns, and so on. The difference might be between:
我通常发现自己利用动态编程语言的一种方法是简化和澄清语法。例如,如果我代表一个数据库,那么我用来与它进行交互的语法可以更加清晰,如果我可以在数据库对象上为其表,列的表和行动态加载属性和方法,等等。差异可能在于:
$row = $db->getTable('user')->getRow(27);
$row->setValue('name', 'Bob');
and
$row = $db->user->getRow(27);
$row->name = 'Bob';
The 'visual noise savings' of the second form really starts to add up when you're doing complex things.
当你做复杂的事情时,第二种形式的“视觉噪音节省”真的开始增加。
#3
Dynamic Languages can change the object at run time, you can add methods, properties...
动态语言可以在运行时更改对象,可以添加方法,属性......
One good example of Dynamic Languages magic is this Groovy code snippet which call a method on a webservice in just two lines of code:
动态语言魔术的一个很好的例子是这个Groovy代码片段,它只用两行代码调用web服务上的方法:
def proxy = new SoapClient("http://localhost:6980/MathServiceInterface?wsdl");
def result = proxy.add(1.0, 2.0);
This is another Groovy snippet that extract data from XML:
这是另一个从XML中提取数据的Groovy代码段:
def contacts = new XmlParser().parseText("<contacts><name>Bahaa Zaid</name></contacts>");
def myName = contacts.name[0].text();
You cannot do this in Static Languages. Dynamic Language can change the objects to reflect the actual runtime condition.
您不能在静态语言中执行此操作。动态语言可以更改对象以反映实际的运行时条件。
#4
I think the most dramatic difference in choice of data structures.
我认为数据结构选择中最显着的差异。
In Java or C I define structs or classes very strictly. If I need to add a property, I go back and change the definition.
在Java或C中,我非常严格地定义结构或类。如果我需要添加属性,我会返回并更改定义。
In Perl I'll just use a hash, and 'invent' keys as I code.
在Perl中,我只使用哈希,并在编码时使用'发明'键。
#5
In dynamic languages, I'm more experimental. It's easier to change things on the fly, so I can explore solutions faster.
在动态语言中,我更具实验性。动态更改更容易,因此我可以更快地探索解决方案。
If I know what I want to do, and generally how to do it, I like C++. If I don't know how to do what I want to do, and likely am not entirely sure about what I want to do, I much prefer Lisp.
如果我知道我想做什么,以及一般如何做,我喜欢C ++。如果我不知道如何做我想做的事情,并且可能不完全确定我想做什么,我更喜欢Lisp。
#6
Fast iterations make happier programmers, and they don't come any faster than an interactive interpreter. Good interpreter exploitation gives you sandbox, testing, and prototyping at the same time.
快速迭代使程序员更快乐,而且他们的速度并不比交互式解释器快。良好的口译服务可以同时为您提供沙箱,测试和原型设计。
Beware programming by permutation, however. My personal rule of thumb is that it's just because it works doesn't mean it's ready, when you can explain why it works it's ready.
但要注意通过排列进行编程。我个人的经验法则是,它只是因为它起作用并不意味着它已经准备就绪,当你可以解释为什么它能够正常工作时。
#7
My biggest gains are in mapping between databases and objects (ORM).
我最大的收获是数据库和对象(ORM)之间的映射。
If there is no concept of a type, it becomes very easy to say assign every column in a row to a value in an object. Of course the trade off is that there can be a mismatch between the type of value you think is there and what type the computer does.
如果没有类型的概念,则很容易将一行中的每一列分配给对象中的值。当然,权衡的是,您认为存在的价值类型与计算机的类型之间可能存在不匹配。
#8
It comes down to one of my favorite ratios: How much time I spend thinking about solving a problem, vs. how much time I spend thinking about the tool I'm using to solve the problem. Think of it as equivalent to S/N ratios.
它归结为我最喜欢的比率之一:我花了多少时间考虑解决问题,花了多少时间考虑我用来解决问题的工具。可以认为它等同于S / N比率。
With duck-typing languages (which I consider to be the factor that helps me the most with productivity), I simply am able to spend more time thinking about my problem and its solution (and write code that addresses those specifically), and I spend less time keeping the language artifacts straight.
使用鸭子打字语言(我认为这是最能帮助我提高工作效率的因素),我可以花更多的时间来思考我的问题及其解决方案(并编写能够解决这些问题的代码),并且我花了很多钱减少保持语言工件的时间。
Then there's a lot of code I just don't write, involving declarations and especially type-casts.
然后有很多我不写的代码,涉及声明,尤其是类型转换。
But it's mainly keeping my focus in the sweet spot.
但它主要是把我的注意力集中在最佳位置。
#9
I can't cite this right now (my memory is failing me), but I've heard something along the lines of:
我现在不能引用它(我的记忆让我失望),但我听到了以下内容:
The closest the programming industry has come to a silver bullet is managed languages – freeing the programmer from having to worry about the details of memory management and letting them focus more energy on solving the problem at hand.
最接近编程行业的是管理语言 - 让程序员不必担心内存管理的细节,让他们更专注于解决手头的问题。
So, I might venture a guess and say it's not so much that you program differently, it's that you can devote more of your brain to "solving the problem" rather than the solution's implementation details.
所以,我可能冒昧地猜测,并说你的编程并不是那么多,而是你可以将更多的大脑用于“解决问题”,而不是解决方案的实施细节。
#10
More libraries and more important more useable libraries.
更多的库和更重要的更可用的库。
My guess is that the "Duck Typing" usually associated with dynamic languages helps simplify the code significantly and makes writing generic code much easier. You are not constrained by a strict class hierarchy and thus are able to more easily compose components from different libraries together.
我的猜测是,通常与动态语言相关联的“Duck Typing”有助于显着简化代码,并使编写通用代码变得更加容易。您不受严格的类层次结构的约束,因此能够更容易地将来自不同库的组件组合在一起。
#11
John, just based on your update edit of 1/5/09, you might find AMOP an interesting read, and more on the line you're thinking of. It's pretty lisp-centric, but after all many of the good dynamic ideas started there. So if you can enjoy (or get past) that aspect, the authors do discuss the dynamic aspects needed and used to do something like this. It's pretty powerful stuff.
约翰,根据您对1/5/09的更新编辑,您可能会发现AMOP是一个有趣的读物,更多的是您正在考虑的问题。它是以lisp为中心的,但毕竟许多好的动态想法都是从那里开始的。因此,如果您可以欣赏(或过去)这一方面,作者会讨论所需的动态方面并用于做这样的事情。这是非常强大的东西。
#12
I do not have a specific answer, just a suggestion: have a look at the book "Design patterns in Ruby" : it goes over most of the classic design patterns (à la Gamma et al., and more) and express them, quite succinctly, in Ruby :)
我没有具体的答案,只是一个建议:看看“Ruby中的设计模式”这本书:它涵盖了大多数经典设计模式(例如Gamma等人等)并表达了它们,相当简洁地说,在Ruby :)
#13
Dynamic languages are capable of executing code which was created at run-time. This is very dangerous if malicious code is injected. But very powerful if you can sanitize the environment.
动态语言能够执行在运行时创建的代码。如果注入恶意代码,这将非常危险。但如果你能消毒环境,那就非常强大。
I think Javascript people do this by executing JSON files.
我认为Javascript人员通过执行JSON文件来做到这一点。
#14
For me it's turnaround speed. The dynamic languages I use (Python and a bit of JavaScript at the moment) are interpreted. This means I can try things out on the fly. If I want to see how a certain bit of the API behaves I can just hack away at the interpreter for a couple of minutes.
对我来说,这是转机速度。我使用的动态语言(目前是Python和一些JavaScript)被解释。这意味着我可以即时尝试。如果我想看看API的某些行为如何,我可以在解释器上劈开几分钟。
If I wanted to do the same in a language like C# I'd have to fire up VS, make a project, then compile it. If I want to test a part of a bigger piece of software I'm working on I probably have to compile that, which can take ages. Fortunately in .Net I can load up assemblies from the big project in IronPython and get some of the same benefits (i.e. quickly testing out different parts of the API) of interpreted languages.
如果我想用C#这样的语言做同样的事情,我必须启动VS,制作一个项目,然后编译它。如果我想测试我正在研究的更大软件的一部分,我可能需要编译它,这可能需要很长时间。幸运的是,在.Net中,我可以从IronPython中的大项目中加载程序集,并获得解释语言的一些相同的好处(即快速测试API的不同部分)。
#15
Read "Higher Order Perl" by Mark Jason Dominus. It only discusses Perl but it does give techniques that are natural to Perl that would be less natural in most static languages.
阅读Mark Jason Dominus的“高阶Perl”。它只讨论了Perl,但它确实提供了Perl自然的技术,这些技术在大多数静态语言中都不太自然。
All languages obviously have their strengths and weaknesses and dymanic vs static
is only one of many ways to classify a language. I would not make the argument that dynamic languages as a whole are better or worse then static languages. But I do think this book is very good at showing different ways of approaching problems using Perl that would be more difficult or impossible in most Static languages.
只是分类语言的众多方法之一。我不认为动态语言作为一个整体比静态语言更好或更差。但我确实认为本书非常善于展示使用Perl处理问题的不同方法,这在大多数静态语言中会更难或不可能。
#1
I like slim's answer. I do spend a crazy amount of time in Java and C++ crafting custom data structures that are just free in Python/Ruby. And crafting specialized functions to process these custom data structures. Yes, in C++, STL is really nice. Yes, Generics in Java are nice. They help create custom data structures much faster, however they still require a lot of thought and consideration.
我喜欢苗条的回答。我在Java和C ++中花费了大量的时间来制作Python / Ruby中免费的自定义数据结构。并制作专门的函数来处理这些自定义数据结构。是的,在C ++中,STL非常好。是的,Java中的泛型很好。它们有助于更快地创建自定义数据结构,但仍需要大量的思考和考虑。
However, there is a more fundamental reason why dynamic languages are easier to work with. It is a deep idea which is called duck typing. Some comments above refer to duck typing, but please take time to reflect on what duck typing is. It is a fundamentally different way to view the world. A view that is incompatible with languages like Java and C++.
但是,动态语言更容易使用有一个更基本的原因。这是一个深刻的想法,叫做鸭子打字。上面的一些评论涉及鸭子打字,但请花时间思考鸭子打字是什么。这是一种观察世界的根本不同的方式。与Java和C ++等语言不兼容的视图。
Duck typing means that you waste not time in defining what a duck is. By not having to formally define your objects you save a lot of time and energy. Getting definitions right is hard. Have a look at this blog post of mine where I give examples: Formal definitions are less useful than you think
鸭子打字意味着你不会浪费时间来定义鸭子是什么。通过不必正式定义对象,您可以节省大量时间和精力。正确定义很难。看一下我的博客文章,我举例说明:正式定义没有你想象的那么有用
Duck typing has proven extremely useful. The "Must Ignore" principle in XML is what has made XML so significant and useful on the web. But that's just an instance of duck typing.
鸭子打字已证明非常有用。 XML中的“必须忽略”原则使XML在Web上如此重要和有用。但那只是鸭子打字的一个例子。
Another way to express duck typing is by the Web mantra "Be strict in what you send, generous in what you accept". That is also a very fundamental idea.
表达鸭子打字的另一种方式是通过网络口头禅“严格按照你发送的内容,慷慨接受你所接受的”。这也是一个非常基本的想法。
Finally, you may want to back to a long blog post of mine where I explain duck typing and how it relates to things like AI and modelling: Duck Typing, Artificial Intelligence and Philosophy
最后,你可能想回到我的一篇长篇博文,在那里我解释鸭子打字以及它与人工智能和建模之类的关系:鸭子打字,人工智能和哲学
#2
One way I typically find myself taking advantage of dynamic programming languages is in simplifying and clarifying syntax. If I'm representing a database, for example, the syntax I use for interacting with it can be much cleaner if I can dynamically load properties and methods on the database object for its tables, the tables and rows for their columns, and so on. The difference might be between:
我通常发现自己利用动态编程语言的一种方法是简化和澄清语法。例如,如果我代表一个数据库,那么我用来与它进行交互的语法可以更加清晰,如果我可以在数据库对象上为其表,列的表和行动态加载属性和方法,等等。差异可能在于:
$row = $db->getTable('user')->getRow(27);
$row->setValue('name', 'Bob');
and
$row = $db->user->getRow(27);
$row->name = 'Bob';
The 'visual noise savings' of the second form really starts to add up when you're doing complex things.
当你做复杂的事情时,第二种形式的“视觉噪音节省”真的开始增加。
#3
Dynamic Languages can change the object at run time, you can add methods, properties...
动态语言可以在运行时更改对象,可以添加方法,属性......
One good example of Dynamic Languages magic is this Groovy code snippet which call a method on a webservice in just two lines of code:
动态语言魔术的一个很好的例子是这个Groovy代码片段,它只用两行代码调用web服务上的方法:
def proxy = new SoapClient("http://localhost:6980/MathServiceInterface?wsdl");
def result = proxy.add(1.0, 2.0);
This is another Groovy snippet that extract data from XML:
这是另一个从XML中提取数据的Groovy代码段:
def contacts = new XmlParser().parseText("<contacts><name>Bahaa Zaid</name></contacts>");
def myName = contacts.name[0].text();
You cannot do this in Static Languages. Dynamic Language can change the objects to reflect the actual runtime condition.
您不能在静态语言中执行此操作。动态语言可以更改对象以反映实际的运行时条件。
#4
I think the most dramatic difference in choice of data structures.
我认为数据结构选择中最显着的差异。
In Java or C I define structs or classes very strictly. If I need to add a property, I go back and change the definition.
在Java或C中,我非常严格地定义结构或类。如果我需要添加属性,我会返回并更改定义。
In Perl I'll just use a hash, and 'invent' keys as I code.
在Perl中,我只使用哈希,并在编码时使用'发明'键。
#5
In dynamic languages, I'm more experimental. It's easier to change things on the fly, so I can explore solutions faster.
在动态语言中,我更具实验性。动态更改更容易,因此我可以更快地探索解决方案。
If I know what I want to do, and generally how to do it, I like C++. If I don't know how to do what I want to do, and likely am not entirely sure about what I want to do, I much prefer Lisp.
如果我知道我想做什么,以及一般如何做,我喜欢C ++。如果我不知道如何做我想做的事情,并且可能不完全确定我想做什么,我更喜欢Lisp。
#6
Fast iterations make happier programmers, and they don't come any faster than an interactive interpreter. Good interpreter exploitation gives you sandbox, testing, and prototyping at the same time.
快速迭代使程序员更快乐,而且他们的速度并不比交互式解释器快。良好的口译服务可以同时为您提供沙箱,测试和原型设计。
Beware programming by permutation, however. My personal rule of thumb is that it's just because it works doesn't mean it's ready, when you can explain why it works it's ready.
但要注意通过排列进行编程。我个人的经验法则是,它只是因为它起作用并不意味着它已经准备就绪,当你可以解释为什么它能够正常工作时。
#7
My biggest gains are in mapping between databases and objects (ORM).
我最大的收获是数据库和对象(ORM)之间的映射。
If there is no concept of a type, it becomes very easy to say assign every column in a row to a value in an object. Of course the trade off is that there can be a mismatch between the type of value you think is there and what type the computer does.
如果没有类型的概念,则很容易将一行中的每一列分配给对象中的值。当然,权衡的是,您认为存在的价值类型与计算机的类型之间可能存在不匹配。
#8
It comes down to one of my favorite ratios: How much time I spend thinking about solving a problem, vs. how much time I spend thinking about the tool I'm using to solve the problem. Think of it as equivalent to S/N ratios.
它归结为我最喜欢的比率之一:我花了多少时间考虑解决问题,花了多少时间考虑我用来解决问题的工具。可以认为它等同于S / N比率。
With duck-typing languages (which I consider to be the factor that helps me the most with productivity), I simply am able to spend more time thinking about my problem and its solution (and write code that addresses those specifically), and I spend less time keeping the language artifacts straight.
使用鸭子打字语言(我认为这是最能帮助我提高工作效率的因素),我可以花更多的时间来思考我的问题及其解决方案(并编写能够解决这些问题的代码),并且我花了很多钱减少保持语言工件的时间。
Then there's a lot of code I just don't write, involving declarations and especially type-casts.
然后有很多我不写的代码,涉及声明,尤其是类型转换。
But it's mainly keeping my focus in the sweet spot.
但它主要是把我的注意力集中在最佳位置。
#9
I can't cite this right now (my memory is failing me), but I've heard something along the lines of:
我现在不能引用它(我的记忆让我失望),但我听到了以下内容:
The closest the programming industry has come to a silver bullet is managed languages – freeing the programmer from having to worry about the details of memory management and letting them focus more energy on solving the problem at hand.
最接近编程行业的是管理语言 - 让程序员不必担心内存管理的细节,让他们更专注于解决手头的问题。
So, I might venture a guess and say it's not so much that you program differently, it's that you can devote more of your brain to "solving the problem" rather than the solution's implementation details.
所以,我可能冒昧地猜测,并说你的编程并不是那么多,而是你可以将更多的大脑用于“解决问题”,而不是解决方案的实施细节。
#10
More libraries and more important more useable libraries.
更多的库和更重要的更可用的库。
My guess is that the "Duck Typing" usually associated with dynamic languages helps simplify the code significantly and makes writing generic code much easier. You are not constrained by a strict class hierarchy and thus are able to more easily compose components from different libraries together.
我的猜测是,通常与动态语言相关联的“Duck Typing”有助于显着简化代码,并使编写通用代码变得更加容易。您不受严格的类层次结构的约束,因此能够更容易地将来自不同库的组件组合在一起。
#11
John, just based on your update edit of 1/5/09, you might find AMOP an interesting read, and more on the line you're thinking of. It's pretty lisp-centric, but after all many of the good dynamic ideas started there. So if you can enjoy (or get past) that aspect, the authors do discuss the dynamic aspects needed and used to do something like this. It's pretty powerful stuff.
约翰,根据您对1/5/09的更新编辑,您可能会发现AMOP是一个有趣的读物,更多的是您正在考虑的问题。它是以lisp为中心的,但毕竟许多好的动态想法都是从那里开始的。因此,如果您可以欣赏(或过去)这一方面,作者会讨论所需的动态方面并用于做这样的事情。这是非常强大的东西。
#12
I do not have a specific answer, just a suggestion: have a look at the book "Design patterns in Ruby" : it goes over most of the classic design patterns (à la Gamma et al., and more) and express them, quite succinctly, in Ruby :)
我没有具体的答案,只是一个建议:看看“Ruby中的设计模式”这本书:它涵盖了大多数经典设计模式(例如Gamma等人等)并表达了它们,相当简洁地说,在Ruby :)
#13
Dynamic languages are capable of executing code which was created at run-time. This is very dangerous if malicious code is injected. But very powerful if you can sanitize the environment.
动态语言能够执行在运行时创建的代码。如果注入恶意代码,这将非常危险。但如果你能消毒环境,那就非常强大。
I think Javascript people do this by executing JSON files.
我认为Javascript人员通过执行JSON文件来做到这一点。
#14
For me it's turnaround speed. The dynamic languages I use (Python and a bit of JavaScript at the moment) are interpreted. This means I can try things out on the fly. If I want to see how a certain bit of the API behaves I can just hack away at the interpreter for a couple of minutes.
对我来说,这是转机速度。我使用的动态语言(目前是Python和一些JavaScript)被解释。这意味着我可以即时尝试。如果我想看看API的某些行为如何,我可以在解释器上劈开几分钟。
If I wanted to do the same in a language like C# I'd have to fire up VS, make a project, then compile it. If I want to test a part of a bigger piece of software I'm working on I probably have to compile that, which can take ages. Fortunately in .Net I can load up assemblies from the big project in IronPython and get some of the same benefits (i.e. quickly testing out different parts of the API) of interpreted languages.
如果我想用C#这样的语言做同样的事情,我必须启动VS,制作一个项目,然后编译它。如果我想测试我正在研究的更大软件的一部分,我可能需要编译它,这可能需要很长时间。幸运的是,在.Net中,我可以从IronPython中的大项目中加载程序集,并获得解释语言的一些相同的好处(即快速测试API的不同部分)。
#15
Read "Higher Order Perl" by Mark Jason Dominus. It only discusses Perl but it does give techniques that are natural to Perl that would be less natural in most static languages.
阅读Mark Jason Dominus的“高阶Perl”。它只讨论了Perl,但它确实提供了Perl自然的技术,这些技术在大多数静态语言中都不太自然。
All languages obviously have their strengths and weaknesses and dymanic vs static
is only one of many ways to classify a language. I would not make the argument that dynamic languages as a whole are better or worse then static languages. But I do think this book is very good at showing different ways of approaching problems using Perl that would be more difficult or impossible in most Static languages.
只是分类语言的众多方法之一。我不认为动态语言作为一个整体比静态语言更好或更差。但我确实认为本书非常善于展示使用Perl处理问题的不同方法,这在大多数静态语言中会更难或不可能。