在命令式编程语言中,我们必须在算法中考虑每个原子步骤。
In imperative programming languages, I must think about each atomic step in my algorithm.
要使用函数性语言,只需要放弃命令式编程的风格。
To use a functional language, you just need to let go of imperative programming styles. Learning to write in a more functional style has several benefits.
很难想像没有这些特征的编程语言,因为命令式语言“告诉我如何做”的方式是如此深刻地确立在我们的日常编程哲学中。
It's hard to imagine programming languages without these characteristics because imperative languages' "tell me how to do it" approach is so firmly entrenched in our everyday programming philosophies.
表1显示了几种常见的命令式或声明式编程语言。
Table 1 shows several common programming languages categorized as either imperative or declarative.
如果您和大多数程序员一样,那么您一定是从像 C++ 的命令式语言开始您的编程生涯的。
If you're like most programmers, you started your career with an imperative language like C++.
因为宏可以以任何方式展开常规代码,所以如果声明式语言不能满足需要,那么随时可以切换回命令式编程。
Since the macro expands to regular code anyway, you can always switch back to imperative programming if the declarative language doesn't suit your needs.
函数编程方式很容易理解,但是如果您习惯了过程序和关注状态的命令式语言,可能不太容易适应它。
The functional programming approach is easy to understand, but can be difficult to apply if you are used to the more procedural and state-focused imperative languages.
不太久之前编程语言还可以毫无疑义地归类成“命令式”或者“函数式”。
Until relatively recently programming languages have fit neatly into either "imperative" or "functional" categories.
函数式编程为您提供了新的、不同的构建块,可以实现命令式语言使用其他机制实现的相同效果。
Functional programming gives you new, different building blocks to achieve the same goals that imperative languages accomplish with other mechanisms.
最受欢迎的通用编程语言(包括Python和其它面向对象的语言)在样式上绝大多数都是命令式的。
The most popular general purpose programming languages -- including Python and other object-oriented languages -- are predominantly imperative in style.
最受欢迎的通用编程语言(包括Python和其它面向对象的语言)在样式上绝大多数都是命令式的。
The most popular general purpose programming languages -- including Python and other object-oriented languages -- are predominantly imperative in style.
应用推荐