“强大"是什么意思?是说,在讨论编程语言时? [英] What does "powerful" mean, when discussing programming languages?

查看:49
本文介绍了“强大"是什么意思?是说,在讨论编程语言时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编程语言讨论/比较的上下文中,术语能力"是什么意思?

它有明确的含义吗?甚至定义不明确的含义?

如果有人说X 语言比 Y 语言更强大"或提出同样的问题,他们的意思是什么 - 或者他们想找出什么信息?

解决方案

它没有明确的含义.在这些类型的讨论中,X 语言比 Y 语言更强大"通常意味着我更喜欢 X 语言而不是 Y 语言".在光谱的另一端,您通常还会有人插话谈论任何图灵完备语言如何完成与任何其他图灵完备语言相同的任务,因此严格来说两者都不比另一个强大.

我认为它的一个很好的含义是表现力.当一种语言具有高度表达能力时,这意味着表达概念所需的代码更少.对我来说,这不仅意味着您必须编写更少的代码来完成相同的任务,而且还意味着代码很容易被人类阅读.当然,一般来说(在某种程度上),要阅读的代码行数更少,可以让人类更轻松地阅读和理解任务.

拥有一个强大"的标准库在这里发挥着同样的作用.如果一种语言配备了全面、完整的库,那么该语言中的惯用代码将能够从现有的库代码中受益,而不必重复或重新发明应用程序代码中的通用功能.同样,最终结果是,为了完成相同的任务,必须编写和阅读更少的代码.

我一直在说一般"和在一定程度上",因为一旦语言变得过于简洁,人类就更难破译.我想在这种极端情况下,一种语言可能仍然被认为更强大"(甚至太强大").所以我想我是说我个人对强大"的解释也包括有用"和可读"的某些方面.

In the context of programming language discussion/comparison, what does the term "power" mean?

Does it have a well defined meaning? Even a poorly defined meaning?

Say if someone says "language X is more powerful than language Y" or asks the same as a question, what do they mean - or what information are they trying to find out?

解决方案

It does not have a well-defined meaning. In these types of discussions, "language X is more powerful than language Y" usually means little more than "I like language X more than language Y." On the other end of the spectrum, you'll also usually have someone chime in about how any Turing-complete language can accomplish the same tasks as any other Turing-complete language, so that neither is strictly more powerful than the other.

I think a good meaning for it is expressivity. When a language is highly expressive, it means less code is required to express concepts. To me, this doesn't just mean that you have to write less code to accomplish the same tasks, but also that the code is easily readable by humans. Of course, generally (to a point), having fewer lines of code to read makes the task of reading and understanding easier for humans.

Having a "powerful" standard library comes into play here along the same lines. If a language comes equipped with thorough, complete libraries, then idiomatic code in that language will be able to benefit from the existing library code and not have to repeat or reinvent common functionality in application code. The end result is, again, having to write and read less code to accomplish the same tasks.

I keep saying "generally" and "to a point", because once a language gets too terse, it gets more difficult for humans to decipher. I suppose at this extreme, a language may still be considered "more powerful" (or even "too powerful"). So I guess I'm saying my personal interpretation of "powerful" includes some aspects of "useful" and "readable" in it as well.

这篇关于“强大"是什么意思?是说,在讨论编程语言时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆