Live data from Hacker News

Semantic compression (2014)

caseymuratori.com

11–20 of 33 posts

Re: Semantic compression (2014)

#11
post #5

A page-long strawman isn't a great way to start an article. I also disagree with the author's claim that refactoring is ridiculous or different, but like the author I'm not going to elaborate.

What's the strawman? This way of thinking is taught in universities around the world. And it doesn't stay there. I personally know people who approach problems like this.

Re: Semantic compression (2014)

#12
I was actually in the school of thought that this article describes until I read and worked through the book How to Design Programs [0]. The rest is upto you to judge.

[0] https://htdp.org/

Edit: I would love others, who have read the above mentioned book, to weigh in with your anecdotes.

Re: Semantic compression (2014)

#13
This is from 2014 (it felt awfully familiar when it got to the code samples) but submitted under the title "Semantic Compression" or other variations:

https://news.ycombinator.com/item?id=17090319 - May 17, 2018 (41 comments)

There are others with 1-2 comments but no other discussions beyond that that I can find.

Re: Semantic compression (2014)

#14
It'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.

I suppose they're going for the "wow, are you God?" effect, but when it's a miss, it just makes them look silly.

Re: Semantic compression (2014)

#15
The intro has nothing to do with the rest of the article, really. The author claims it does at the end, but it's just trashing OOP for fun (the author even says this).

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.

The author seems to not enjoy planning before writing code, which I guess is more necessary for OOP than other paradigms?

Re: Semantic compression (2014)

#16
post #5

A page-long strawman isn't a great way to start an article. I also disagree with the author's claim that refactoring is ridiculous or different, but like the author I'm not going to elaborate.

What's the strawman? This way of thinking is taught in universities around the world. And it doesn't stay there. I personally know people who approach problems like this.

At least in my social bubble, composition over inheritance has been the more popular guideline for two decades.

Instead of a Manager class inheriting Employee and Contractor (which in turn inherit Person, which in turn may inherit other classes...), you'd separate employee and contractor into traits/interfaces and define distinct manager classes that implement the two traits. Of course, ultimately it's all classes and inheritance in C++ because there are no traits, but it's organized differently.

Re: Semantic compression (2014)

#17

I was actually in the school of thought that this article describes until I read and worked through the book How to Design Programs [0]. The rest is upto you to judge. [0] https://htdp.org/ Edit: I would love others, who have read the above mentioned book, to weigh in with your anecdotes.

> I was actually in the school of thought that this article describes until I read and worked through the book How to Design Programs

What distinguishes the approach from what is presented in this blog post, can you provide a summary for those of us who haven't read the book? I am sincerely interested.

Re: Semantic compression (2014)

#19

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 fewe…

At that point it's giving you a foreign code base that's hard to reason about until you grok what it is it has done.

Prompting you to make the changes allows you to cognitively keep up in lockstep with the code changes. Further, it has no concept of your present/future intent, so perhaps not all of its suggestions apply.

Re: Semantic compression (2014)

#20
post #7

TL;DR: DRY Nice read, though. Very approachable.

Yep, but with the added condition of “don’t DRY pre-maturely, that is, before you have duplicated code”.

Which, coincidentally, is also the advice paired with DRY by most competent people (including in the main book people seem to have learned DRY from, The Pragmatic Programmer). Apply it after repetitions, not before.
Post reply on HN