动态类型语言值得所有的批评吗?

发布于 2024-09-10 05:38:37 字数 1431 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

稍尽春風 2024-09-17 05:38:37

“企业”这个词对我来说没有任何意义,所以我只是假设您正在谈论大公司。

动态类型就是这样:动态。无法使用动态类型语言有效地静态分析程序。静态类型允许开发人员在编译或运行代码之前发现错误,这在企业界非常重要。它使调试变得不再那么痛苦,从而提高了整体生产力(或者这就是他们所说的,无论如何)。静态类型在团队环境中也非常重要,因为它允许您的 IDE 告诉您如何使用您从未见过的方法。使用动态类型语言来实现这些类型的“提示”即使不是不可能,也是非常困难的。

另一件大事是动态语言根本不像静态语言那么成熟。 C++、Java 和 C# 等语言已在企业界使用多年,而动态类型语言最近才开始发挥作用。用 Java 编写的代码比用 Python 编写的代码多得多,而且对前者的支持也多得多。


请注意,我并不支持任何一方。我个人更喜欢动态类型语言,因为它们可以让我更快地编写代码,花更少的时间思考问题,但我可以看到像 C# 这样的语言在庞大的企业环境中的吸引力。

The word "enterprise" doesn't really mean anything to me, so I'm just going to assume you're talking about large corporations.

Dynamic typing is just that: dynamic. There is no way to effectively statically analyze your program with a dynamically-typed language. Static typing allows developers to catch mistakes before ever compiling or running their code, something that is very important in the corporate world. It makes debugging much less of a pain and thus increases overall productivity (or that's what they argue, anyway). Static typing is also very important in a team setting because it allows your IDE to tell you how to use a method that you've never seen. These kinds of "hints" are very difficult, if not impossible, to achieve with dynamically-typed languages.

The other big thing is that dynamic languages are simply not as mature as static languages. Languages like C++, Java, and C# have been in use in the corporate world for years and years and years, whereas dynamically typed languages are just recently coming into play. There is a lot more code written in Java than in Python, and a lot more support for the former as well.


Note that I'm not arguing for either side. I personally prefer dynamically-typed languages because they allow me to write the code much more quickly and spend less time thinking about the problem, but I can see the appeal of languages like C# in a huge corporate environment.

情话难免假 2024-09-17 05:38:37

可能更多的是人们熟悉的东西。从经理的角度来看,他/她需要有充分的理由来使用以下技术:

  • 公司可能从未在项目中使用过,
  • 团队中没有人有任何经验,
  • 不(似乎)具备坚实的“企业”公司(例如 Microsoft、IBM 等)的支持

如果项目需要在未来多年进行维护,这些因素尤其重要。

我并不是要捍卫这个观点,只是指出它的存在,并且可能是这种批评的根源。

It's probably more about what people are familiar with than anything else. From a manager's point of view, he/she needs a good reason to use a technology that:

  • May have never been used by the company on a project,
  • No one on the team has any experience with,
  • Does not (appear to) have the backing of a solid "Enterprise" company such as Microsoft, IBM, etc

These factors are especially important if the project needs to be maintained for many years down the road.

I am not defending this point of view, just pointing out that it exists and may be a source of this criticism.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文