3 ms·
"smaller" there was short-hand for "more focused, purpose-built to your problem, less generic". All of those properties make the code easier to reason about an
by TheDong 6y ago
"smaller" there was short-hand for "more focused, purpose-built to your problem, less generic".
All of those properties make the code easier to reason about and test.
Being easier to reason about, and being a more exact abstraction for my needs, are both incredibly valuable properties.
- scarface74 6y agoMore generic is better. If I go into a codebase that uses standard libraries. Even if I don’t know how to do something about it someone on the Internet does. Your custom framework - not so much. I don’t have to care about how the underlying libraries work. I can treat them as a black box.
- TheDong 6y ago> I don’t have to care about how the underlying libraries work. I can treat them as a black box. When I wrote haskell, the majority of the libraries did just work, and I didn't have to dig into their code to find bugs often. When I wrote javascript, hundreds of the libraries I used did not just work. I usually had to care very much about their details because they were poorly implemented, full of bugs and incorrect abstractions, and often abandoned soon after. I agree that there's benefits in reusing some well-socialized and well-implemented generic frameworks and abstractions. It's not worth using generic abstractions that are not well understood, buggy, and don't match your needs closely. In that case, write your own. More generic is not always better. Above, I'm arguing that it's important for code to be easier to reason about. If a generic abstraction helps with that, cool, but it's not always going to be the case.
- scarface74 6y agoThat’s also why I stay away from the clusterf%%% of front end development and JS if possible except for simple AWS Lambda scripts that have one dependency - AWS SDK. Any other scripting I do with Python. Any more complicated development it’s using a language with an ecosystem with adults - C# or Go.
- TheDong 6y agoKinda ironic that you say "More generic is better" a few comments above, and then also cite Go in a positive light. Rob pike espoused "A little copying is better than a little dependency", and go refuses to add suitable abstractions to build generic reusable pieces. Go has a strong culture of doing exactly the sort of thing I was talking about, and you were arguing against.
- toast0 6y agoWhat do you do when the black box doesn't work? Almost everything I work with has bugs, so chances are I'm going to run into one. It's a lot easier for me to fix bugs when there are fewer layers and more of them are written by me. Of course, I can't write all the layers, but if they run on my service, I have to be prepared to fix them, or suffer from them being broken until a benevolent force fixes them for me. (Sometimes that happens, but usually not for the harder problems)
- scarface74 6y agoUntil I have to come in behind you after you’ve left for greener pastures and I have to figure out your bespoke framework and libraries.
- toast0 6y agoDon't worry, I would never write a bespoke framework. I'd write a custom one. :P