TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

YAML: Probably not so great after all

60 点作者 calpaterson超过 1 年前

13 条评论

andrei_says_超过 1 年前
Yes, it’s not perfect.<p>Still, totally fine for pretty much everything I’ve needed it for.<p>Maybe I&#x27;m just not that ambitious and haven’t hit any of the corner cases pointed out in the article.<p>Have been using it as a html forms definition language for 7 years - with great success.<p>So, yes, maybe not so great, but also not too bad.
评论 #37700031 未加载
luzifer42超过 1 年前
One big issue is that if a YAML file gets truncated for some reason, parsers generally don&#x27;t complain.
评论 #37701720 未加载
eviks超过 1 年前
&gt; You’ll need to scroll up, but then you need to keep track of the indentation, which can be pretty hard even with indentation guides,<p>Or you can collapse all the groups in your text editor and usually easily see what level you&#x27;re at
unethical_ban超过 1 年前
Whitespace significance is awful. After some time questioning why I have fallen out of love with python, I realized that is part of the answer.
评论 #37703703 未加载
评论 #37700093 未加载
评论 #37703999 未加载
评论 #37699044 未加载
评论 #37701016 未加载
deafpolygon超过 1 年前
For simple, straightforward configs, it&#x27;s probably better to use TOML. Anything more complicated can be shunted to XML. Just define a spec (schema) for it and you&#x27;re good to go. Especially if that is going to be used as a data exchange for other applications or uses.
c7DJTLrn超过 1 年前
90% of the people using YAML are not using 90% of the features in the spec. Somebody should make a subset of YAML with just the essentials while still remaining compatible. Maybe fix some of the type ambiguity stuff as well.
评论 #37698368 未加载
bagasme超过 1 年前
After I digged into related articles on the link, it seems like the holy grail to the config files dilemma is to just hard-code desired settings in the source code. However, it also means that users (especially using binary packages) are stuck with settings from the distro.<p>If you truly needs user-configurable setting, maybe TOML is for you.
评论 #37697786 未加载
评论 #37700931 未加载
评论 #37700136 未加载
评论 #37701434 未加载
koromak超过 1 年前
Everyone hates yaml and I mostly agree. Should we start using something else? At least in the context of CI, I find .INI a little lacking, and TOML has similar gotcha&#x27;s as yaml. At the very least its single-line restrictions frustrating for readability. That might be as subset of TOML though, not sure.<p>Off the top of my head there&#x27;s StrictYAML, which likely solves most of the issues, but I&#x27;d be interested in a pseudo-language similar to Terraform HCL. It seems config-files-as-scripts are here to stay in the CI world, so why not make config files more scriptable?<p>Then theres dumb yaml calling smart bash or Makefiles, which has some benefits as well. But I don&#x27;t see people wanting to split smallish configuration over multiple files. Bash scripts are harder to take in at a glance.
评论 #37735224 未加载
quectophoton超过 1 年前
At this point for my own stuff I just use Lua by default. Just Lua, no stdlib.<p>If I ever want something that is just literals and I&#x27;m sure I won&#x27;t need conditionals or variables or fancy stuff, then I&#x27;d probably go for scfg[1].<p>[1]: <a href="https:&#x2F;&#x2F;git.sr.ht&#x2F;~emersion&#x2F;scfg" rel="nofollow noreferrer">https:&#x2F;&#x2F;git.sr.ht&#x2F;~emersion&#x2F;scfg</a>
pragmatick超过 1 年前
Off topic but the weird ligature in &quot;especially&quot; really threw me off. Strange choice.
arp242超过 1 年前
Isn&#x27;t this just a dupe of this story from yesterday?<p><i>That&#x27;s a Lot of YAML</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37687060">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37687060</a> - Sep 2023 (457 comments)
secondcoming超过 1 年前
Significant whitespace is always a mistake.
评论 #37698770 未加载
doublepg23超过 1 年前
I think we should use X12, personally.
评论 #37700181 未加载