News for hackers. Stuff that matters.
Re:Please do not attempt to simplify this code by austincheney on Friday December 28, 2018 @05:25AM (#18775990)
Abstractions don't remove complexity. Abstractions instead hide the appearance of complexity behind layers of ever increasing code.
Re:Please do not attempt to simplify this code by xendo on Friday December 28, 2018 @05:31AM (#18776006)
You are right that they move the complexity somewhere else, but when abstractions are done right, you don't have to worry how they are implemented when you use them. That is huge benefit.
Re:Please do not attempt to simplify this code by fluffycat on Friday December 28, 2018 @05:42AM (#18776043)
I believe that premature abstraction is terrible. But in some cases good abstractions may help with handling complexity and may make testing easier. I have a feeling that because authors say that this class should not be changed / refactored, they failed to introduce a good abstraction. This also implies that their tests are inadequate.
Re:Please do not attempt to simplify this code by austincheney on Friday December 28, 2018 @07:31AM (#18776385)
I agree with the direction of your opinion, but would say it isn't a matter of helpfulness. In some cases is it is a necessity.

It must be understood that complexity is an economic consideration and not either a financial or technology consideration. It is always already present. Complexity is not something that is created or destroy; but retained, absorbed, or transferred.

Abstractions become necessary when they separate different functional layers to perform different respective responsibilities. In this case complexity is transferred both in and out of a system at a given layer, but you don't care so long as you aren't doing the jobs of the other layers. That is referred to as separation of concerns which results in the hardening of a system (risk reduction) which is the side effect of reducing costs due to restricting requirements available.

Many abstractions exist solely to provide a layer of convenience. In the case where an abstraction does the same job as the code it abstracts risks increase and costs increase. This is because the system continues to simultaneously absorb and transfer complexity like described above, but the requirements between the various layers isn't clearly separated. That results in fulfilling requirements, the same requirements, simultaneously at various layers. This has various names like scope creep, technical debt, and so forth. This is bad because risks and costs increase directly to the correlation of increased code and increased requirements. This is what makes the law of leaky abstractions valid.

It is easy to tell the difference between a necessary abstraction and a wasteful abstraction by the forcefulness of separation. If you can perform the same job in a lower level the abstraction isn't necessary and you are probably better off without it. Most JavaScript frameworks are unnecessary abstractions.

Re:Please do not attempt to simplify this code by mdpopescu on Friday December 28, 2018 @12:46PM (#18778204)
A file is an abstraction that hides an incredibly complex process, possibly even involving quantum effects. I have never found a reason to care about the actual details and managed to do quite a significant amount of work using just the abstraction.