命令式代码和疑问式代码是什么意思

发布于 2024-07-11 14:21:15 字数 60 浏览 4 评论 0原文

我的经理要求我在 ASP.net 中编码。 我的命令式和疑问式代码是什么意思。 它与程序员有什么关系?

My Manager asked me to code in ASP.net. What is meant my imperative and interrogative code.
How it related to programmers?

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

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

发布评论

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

评论(3

笑饮青盏花 2024-07-18 14:21:15

命令式代码不返回值。 它只是做了一些事情。 (vb.net 中的 sub 或 c# 中的 void 返回类型)。

疑问代码确实返回一个值。

Imperative code does not return a value. It just does something. (A sub in vb.net or a void return type in c#).

Interrogative code does return a value.

傾城如夢未必闌珊 2024-07-18 14:21:15

虽然我不确定它是一种“流行”的编程方式,但疑问式编程基本上可以这样总结:

领域特定编程语言
能力上趋于僵化,
取决于图形
界面或脚本语言。 我们
提出以问题为导向的方法
不需要先验知识
编程并且可以轻松适应
到广泛的领域。
疑问式编程的工作原理是
使用“解析”用户的意图
对一系列封闭式的回应
问题。 问题由一个
上下文无关语法指定
外部文件。
-引用

虽然命令式编程是大多数过程代码的编写方式(C 风格) )。

Although I'm not sure its a "popular" way of programming, interrogative-programming is basically summed up by this:

Domain specific programming languages
tend to be rigid in capability and
dependent on either a graphical
interface or a scripting language. We
present a question-oriented approach
that requires no prior knowledge of
programming and can be easily adapted
to a wide range ofdomains.
Interrogative programming works by
"parsing" the user's intent using the
responses to a series of closed-ended
questions. Questions are guided by a
context free grammar specified in an
external file.
-Quote

While imperative programming is the way most procedural code is written (C style).

半仙 2024-07-18 14:21:15

英语中的祈使句的意思是“命令的语气”。 因此,一个似乎告诉计算机“做这个,做那个”的程序是命令式程序。 AC 计划就是一个很好的例子。

与此相反,还有其他被称为声明性的语言,例如 Haskell,它们读起来就像数学定理一样,似乎不需要计算机提供任何东西。

Imperative in English means in a 'commanding tone'. So a program that seems to be telling the computer to "do this, do that" is an imperative program. A C program is a good example of that.

As opposed to this there are other languages that are called declarative such as Haskell, that read like mathematical theorems without seeming to demand anything from the computer.

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