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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Semantic compression (2014)

79 点作者 noob_eng将近 2 年前

13 条评论

davidmurdoch将近 2 年前
The intro has nothing to do with the rest of the article, really. The author claims it does at the end, but it&#x27;s just trashing OOP for fun (the author even says this).<p>OOP is fine. And DRY (what the core idea of the article is getting at) applies in OOP paradigms as much any another. The arguments the author makes are orthogonal to OOP.<p>The author seems to not enjoy planning before writing code, which I guess is more necessary for OOP than other paradigms?
评论 #36459534 未加载
kubb将近 2 年前
It&#x27;s really weird when the blogger assumes they know exactly what I do and think, here that I think of a class hierarchy as the first thing when writing a C++ program.<p>I suppose they&#x27;re going for the &quot;wow, are you God?&quot; effect, but when it&#x27;s a miss, it just makes them look silly.
评论 #36460068 未加载
评论 #36459924 未加载
debanjan16将近 2 年前
I was actually in the school of thought that this article describes until I read and worked through the book <i>How to Design Programs</i> [0]. The rest is upto you to judge.<p>[0] <a href="https:&#x2F;&#x2F;htdp.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;htdp.org&#x2F;</a><p>Edit: I would love others, who have read the above mentioned book, to weigh in with your anecdotes.
评论 #36459196 未加载
uzerfcwn将近 2 年前
A page-long strawman isn&#x27;t a great way to start an article. I also disagree with the author&#x27;s claim that refactoring is ridiculous or different, but like the author I&#x27;m not going to elaborate.
评论 #36458197 未加载
PoignardAzur将近 2 年前
Semantic compression is such a cool shorthand.<p>This article really helped me put things I had believed for years into words when I first read it. It&#x27;s pretty amazing.
评论 #36482293 未加载
BaculumMeumEst将近 2 年前
The introduction describes encountering awkwardness during modeling in OOP, which definitely does happen. But I’m not convinced that a payroll system written in C++ in the style described by the post is going to be a better solution.
Jtsummers将近 2 年前
This is from 2014 (it felt awfully familiar when it got to the code samples) but submitted under the title &quot;Semantic Compression&quot; or other variations:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17090319">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17090319</a> - May 17, 2018 (41 comments)<p>There are others with 1-2 comments but no other discussions beyond that that I can find.
badtension将近 2 年前
How&#x27;s this different from just refactoring? Why the fancy name?
评论 #36457954 未加载
评论 #36457495 未加载
soItGoesAgain将近 2 年前
I think semantic compression is achieved by using a denser more expressive language, some languages can express the same activity in far fewer lines of code. Personally I find the denser code, harder to read, which I think also makes sense, since it contains more meaning in less space. If you are writing code, perhaps in python, and you keep following your editors instructions to refactor it, you end up with far fewer repeated lines of code, and lots of small reused functions, you are actually doing manual code compression. I have always wondered why, if editors are so smart, they don&#x27;t have a &#x27;compress this project&#x27; button, which does all that for you.
评论 #36459258 未加载
hyperhello将近 2 年前
All he wanted to do was have some buttons that react to the mouse and run code. At this point, such a thing should be a language primitive like floating point.
pacifika将近 2 年前
Jargon abstraction
mcdonje将近 2 年前
TL;DR: DRY<p>Nice read, though. Very approachable.
评论 #36459224 未加载
ilaksh将近 2 年前
So I guess he thinks that classes are great as long as there is never any inheritance? And so if you do that then it doesn&#x27;t count as object oriented programming or something. Especially if you give it a new name like &quot;semantic compression&quot;. Lol.<p>I think the newish thing is traits such as in Rust.
评论 #36460077 未加载
评论 #36461453 未加载