logoalt Hacker News

globular-toasttoday at 9:17 AM2 repliesview on HN

There are two stages to becoming a decent programmer: first you learn to use abstraction, then you learn when not to use abstraction.

Trying to find the right level is the art. Once you learn the tools of the trade and can do abstraction, it's natural to want to abstract everything. Most programmers go through such a phase. But sometimes things really are distinct and trying to find an abstraction that does both will never be satisfactory.

When building a house there are generally a few distinct trades that do the work: bricklayers, joiners, plumbers, electricians etc. You could try to abstract them all: it's all just joining stuff together isn't it? But something would be lost. The dangers of working with electricity are completely different to working with bricks. On the other hand, if people were too specialised it wouldn't work either. You wouldn't expect a whole gang of electricians, one who can only do lighting, one who can only do sockets, one who can only do wiring etc. After centuries of experience we've found a few trades that work well together.

So, yes, it's all just abstraction, but you can go too far.


Replies

knollimartoday at 2:17 PM

In higher end work they do have specialized lighting, branch power, and feeder electricians. And among feeder even special ones for medium voltage etc

throwaway132448today at 9:37 AM

Well said, great analogy. Sometimes the level of abstraction feels arbitrary - you have to understand the circumstances that led there to see why it's not.