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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

JSON is usually the least bad option for machine-readable output formats

2 点作者 goranmoomin9 个月前

1 comment

3np9 个月前
One of these days I should write a &quot;Falsehood programmers believe about JSON&quot; piece... The two major pain-points with JSON I see recurring and causing issues:<p>- You need to process the entire document before you can (de)serialize. It&#x27;s not rare to see pathological cases of this resulting in 100~1000x resource requirements compared to a simpler line-based format like CSV&#x2F;TSV&#x2F;0xFFSV. Streaming JSON deserialization can only be achieved to limited extent by &quot;JSONL&quot; (concatenating documents on the root level instead of wrapping them in an array).<p>- Numbers are floating point. The only way to reliably represent decimal numbers is by wrapping them as strings.<p>- You can not rely on the consistency of a hash of the JSON-serialization as it&#x27;s not well-defined and varies between implementations. You need to specify a well-defined strict subset of JSON with custom serialization if you want this (at this point, are you really reaping the benefits of JSON?). I&#x27;ve seen this one resulting in entire protocols&#x2F;stacks being rewritten from the ground up due to inability to get required interop working.
评论 #41346298 未加载