知识卡片
按复杂度选择语言
声明式语言适合清楚表达直接资源定义,但复杂可配置组件可能充满条件和间接结构;通用命令式语言便于表达复杂逻辑,却可能让简单声明变冗长。工具应按系统部位和团队经验选择,不必强迫整个基础设施只用一种语言。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 基础设施工具与语言 · 查看原书依据
Declarative languages get messier when used to write more-complex components, and especially when used to create configurable components. On the other hand, using a fully imperative language for straightforward infrastructure definitions often creates code that is unnecessarily verbose. This is why I recommend not trying to use a single language across a large, complex infrastructure
参考来源
- 位置:《Infrastructure As Code》第4章《基础设施工具与语言》(来源项目 book-sources,源文件:extracted/Infrastructure As Code/_epub-src/OEBPS/ch04.html)
- 结论依据:原文对该概念的定义、应用条件与作用机制直接支持上述解释。
- 原始内容:Declarative languages get messier when used to write more-complex components, and especially when used to create configurable components. On the other hand, using a fully imperative language for straightforward infrastructure definitions often creates code that is unnecessarily verbose. This is why I recommend not trying to use a single language across a large, complex infrastructure