TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Debunking the myths about parsing JSON in Swift

23 pointsby jtbrownover 9 years ago

5 comments

seivanover 9 years ago
Yes! Someone finally said it. The worst are the operators. You don&#x27;t need these libraries and their lack of tests.<p>Noticed this might be an ad about a book... Parsing JSON in Swift. The bubble is real. What developer would buy this? What&#x27;s next, a book about NSURLSession?
评论 #11126222 未加载
mpweiherover 9 years ago
And here&#x27;s your regularly scheduled announcement that the actual <i>JSON parsing</i> is done by the library call NSJSONSerialization.JSONObjectWithData(...) in line 3 of the code.<p>The rest is just getting the parsed data out of already parsed nested dictionaries and arrays in a way that makes the type checker happy. Calling that &quot;parsing&quot; is probably the biggest myth of them all (though agreed about all the other myths).
评论 #11127025 未加载
hxucaaover 9 years ago
Swiftz (<a href="https:&#x2F;&#x2F;github.com&#x2F;typelift&#x2F;Swiftz" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;typelift&#x2F;Swiftz</a>) offers well tested implementation of operator definitions and constructs from functional language. It takes inspiration from Scalaz and Haskell. If I were to write a library using wacky operators, I&#x27;d at least use well defined and maintained definitions.
wrong_variableover 9 years ago
Why is parsing JSON a problem in 2016 ?
评论 #11126627 未加载
seanalltogetherover 9 years ago
doesn&#x27;t look like it&#x27;s protecting against nsnull values
评论 #11128075 未加载