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.

Clever Functional Design

130 pointsby gsempeover 5 years ago

2 comments

macintuxover 5 years ago
&gt; it was the structural constraint of already being in an immutable context that prompted the cleaner design.<p>Yes! This is what I think most languages retrofitted to include functional features miss: the constraints of immutability and (customarily) no global variables force you to think about what data you actually need where, and often lead to a cleaner design.<p>Constraints are incredibly valuable.
评论 #20815351 未加载
评论 #20817421 未加载
skybrianover 5 years ago
Nice. Although it&#x27;s not mentioned, it seems like the insight here is partially about the lingering effects on the API of one model of persistence?<p>A log is normally considered a stream that&#x27;s too large to keep in memory and needs to be incrementally persisted to disk on the fly, in timestamp order. (Or at least, the traditional file-based way does that, which affects the API.) But each HTTP request happens in memory and its log could be kept there.<p>A downside might be if the server crashes in the middle of a request, the request is entirely unlogged? But maybe you could log some values to disk and merge them later.
评论 #20817380 未加载