Live data from Hacker News

Abstraction is expensive

specbranch.com

81–90 of 144 posts

Re: Abstraction is expensive

#81
post #5

Lack of abstraction is also expensive: try writing something large in assembly. I'd say that lack of a language / system of notions adequate to the subject area is expensive. The desire to describe things in a way that's efficient for a particular class of problems leads to invention of various frameworks. Say, Rails makes you hugely productive at solving a particular type of problems (see [Shopify]), though it's les…

"Lack of abstraction is also expensive: try writing something large in assembly."

What about writing something small.

Re: Abstraction is expensive

#82

Earlier quoted context omitted.

I wrote the piece. The argument I tried to get across is: "You must use abstractions. Find the ones whose values align with your interests." I find people frequently torturing their problems into abstractions they like rather than finding abstractions that work for their applications, and this is very much wrong. Edit: By the way, the examples are fairly low-level databases because that's what I know about. If I knew…

The material is good, nice going. But the title is misleading.

I would argue that abstractions are usually expensive.

It's just that sometimes not doing something expensive is also expensive. Getting your car regularly maintained is expensive, so is not doing that.

The issue with abstractions is that people have not internalized them as "an expensive thing we do to prevent ourselves from running into expensive problems later"; they're internalized them as a zero/low-cost process that has no downsides and thus should be pursued all the time.

It's like if people said, "not getting your oil changed will be more expensive, and therefore I get my oil changed every other week."

I kind of think that the only reason that the phrase "abstractions are expensive" sounds like a controversial take is precisely because people have not internalized that abstractions are not a binary good/bad thing and that they should be applied situationally, because they do have maintenance costs and development costs.

Re: Abstraction is expensive

#83

Earlier quoted context omitted.

I wish it was a meme. The things people complained about decades ago are still happening today, and the practitioners are all too eager to turn a 100 line program into a 1000 line one, while taking weeks to test if it does what it should. The average loud dev is a GoF fanatic in love with inaccessible reflection. Double points if their tools are still stuck in a time where stack traces weren't extended to deal with s…

Call me blunt, but ive come to the conclusion most people arent intelligent enough to create complex abstractions

my experience is quite the opposite, it's much more difficult to create a simple abstraction as opposed to an overengineered and/or overgeneralized one.

Re: Abstraction is expensive

#84

Earlier quoted context omitted.

The material is good, nice going. But the title is misleading.

I would argue that abstractions are usually expensive. It's just that sometimes not doing something expensive is also expensive. Getting your car regularly maintained is expensive, so is not doing that. The issue with abstractions is that people have not internalized them as "an expensive thing we do to prevent ourselves from running into expensive problems later"; they're internalized them as a zero/low-cost process…

Sure, the statement isn't wrong. But the content is mostly about making good/consistent choices given the situation.

Re: Abstraction is expensive

#85

Earlier quoted context omitted.

The material is good, nice going. But the title is misleading.

I would argue that abstractions are usually expensive. It's just that sometimes not doing something expensive is also expensive. Getting your car regularly maintained is expensive, so is not doing that. The issue with abstractions is that people have not internalized them as "an expensive thing we do to prevent ourselves from running into expensive problems later"; they're internalized them as a zero/low-cost process…

That's very well-phrased, and you beat me to this comment. :)

I wanted to get across that an abstraction is an expensive thing you should use to solve a difficult problem, not a cheap thing you use to solve a simple problem.

Re: Abstraction is expensive

#86

Earlier quoted context omitted.

Call me blunt, but ive come to the conclusion most people arent intelligent enough to create complex abstractions

my experience is quite the opposite, it's much more difficult to create a simple abstraction as opposed to an overengineered and/or overgeneralized one.

complex != overengineered and/or overgeneralized one

some technical problems are actually just complex

Re: Abstraction is expensive

#87

Earlier quoted context omitted.

I wrote the piece. The argument I tried to get across is: "You must use abstractions. Find the ones whose values align with your interests." I find people frequently torturing their problems into abstractions they like rather than finding abstractions that work for their applications, and this is very much wrong. Edit: By the way, the examples are fairly low-level databases because that's what I know about. If I knew…

The material is good, nice going. But the title is misleading.

Thank you. I will add that the title is intentionally provocative. However, I want to encourage developers to think of an abstraction as something you pay a significant cost for rather than something you get for free, and use that logic to make good choices.

In a sense, you hire abstractions a little like you hire employees. Interview them and make sure your values match.

Re: Abstraction is expensive

#88

Earlier quoted context omitted.

my experience is quite the opposite, it's much more difficult to create a simple abstraction as opposed to an overengineered and/or overgeneralized one.

complex != overengineered and/or overgeneralized one some technical problems are actually just complex

sure, but it's easier to solve a complex problem by building an abstraction that is more complex than the problem requires, that to build an abstraction that is as simple as possible (given the complexity inherent to the problem). then, once you have your too-complex abstraction, it can be difficult to restrain yourself, especially as an eager junior developer, to not take your amazing feat of abstraction engineering to its logical, generalized conclusion... or at least die trying.

"see, now, every time I want to do x, all I have to do is y and z, instead of a, b, c, and d" is an incredibly addictive drug! (I write this as a recovering addict.)

Re: Abstraction is expensive

#89

Earlier quoted context omitted.

I would argue that abstractions are usually expensive. It's just that sometimes not doing something expensive is also expensive. Getting your car regularly maintained is expensive, so is not doing that. The issue with abstractions is that people have not internalized them as "an expensive thing we do to prevent ourselves from running into expensive problems later"; they're internalized them as a zero/low-cost process…

That's very well-phrased, and you beat me to this comment. :) I wanted to get across that an abstraction is an expensive thing you should use to solve a difficult problem, not a cheap thing you use to solve a simple problem.

> abstraction is an expensive thing you should use to solve a difficult problem, not a cheap thing you use to solve a simple problem

Nailed it.

Re: Abstraction is expensive

#90
post #2

This sounds like an application risk-aversion/-seeking that Kahneman highlights in "Thinking, Fast and Slow" Specifically... each of these individual decisions (wrt to abstraction, in this context) was made to locally optimize (speed, simplicity, etc) some issue or other But when taken in gestalt, they're overall not only not optimal, but downright bad Most of those decisions are made by people far to close to a tiny…

The title needs work too. People will undoubtedly assume that reducing abstraction will make things cheaper.

Sometimes reducing abstractions will make things cheaper.

Some regular traps that I see people run into with abstractions:

- building around scenarios that they can be pretty confident that they will never need to handle.

- building abstractions that are larger and more complicated than the thing they are abstracting (this tends to happen when people build abstractions of abstractions).

- building abstractions before they have a proper understanding of what they're abstracting and what they'll need to encapsulate.

In many of those cases, reducing abstractions (even just temporarily) reduces complexity.

When I'm building purely personal projects, I don't use abstractions to help me deal with directory structure on Windows, because I don't use Windows, and that would be additional complexity for no benefit -- so it's simpler for me to just work with the lower level OS paths.

When I start writing an abstraction I look at the amount of documentation I'm generating, and if I'm generating more documentation than it would take to explain the underlying system, I look to see if there are concepts that I can remove. I worked at a company where our build process became considerably simpler when we stopped using high-level build tools like Gulp/Grunt and switched to writing simple Node scripts, because it was easier to debug what those scripts were doing. We simplified that process even further by occasionally just dipping into Bash scripts.

Working with low-level concepts for a while often also gives you better understanding of what you need to abstract. I've worked with codebases where the abstractions all get built first, and it's not uncommon for those abstractions to be built around tasks that are pretty simple and easy to do with lower-level code, at the same time that the abstractions completely ignore the really difficult tasks that are very annoying to do. And once abstractions get baked in, it was time consuming and difficult and expensive to pull them out and rewrite them.

Going back to the scripts above, our build process got better because we made it simple to begin with -- a set of scripts, rather than a large established pipeline -- and then as we identified pain points, we started abstracting those pain points away. That allowed us to not waste time rewriting abstractions over and over and instead to have targeted small interfaces that helped us with the actual painful parts of building and deployment.

It is surprisingly common for software to be over-abstracted to the point where it is more complicated to deal with than it would be otherwise. I mean, heck, this comes up in web development all the time, it is one of the primary criticisms people have of the JS ecosystem -- that it overcomplicates development. In many cases those complications exist for reasons, they solve real problems that people have had. But also in many cases, someone's individual blog doesn't need any of that, and it would be cheaper and easier for them to build something smaller and simpler. If I can build a site that is one HTML file and one CSS file, and I know that's all I'm going to need, then it's overkill to try and set up a bunch of abstractions on top of that.

Post reply on HN