3 ms·
(Author here.) The analogy to `git log` is just that, an analogy. Here's a concrete thing that you get with layers that you don't get with `git log` or convent
by akkartik 7y ago
(Author here.)
The analogy to `git log` is just that, an analogy. Here's a concrete thing that you get with layers that you don't get with `git log` or conventional abstractions and refactoring: alternatives. Often we see comments in codebases that some complex, hairy function is really a much simpler function with certain optimizations applied. There's been lots of work done to try to separate out functional spec from optimization so that the two can be managed separately. But this is all open research. Layers let you get the value of this separation today, with very little code (just a lot of reorientation in mindset). If you adopt layers you can use the simple version in an earlier layer, and then replace it in a later layer. Your CI system will exercise both, and flag if either stops passing tests. What used to be a code comment now stays up to date.
- zwieback 7y agothat's a good point about continuing testing reference and optimized solutions - I could see a case being made for standardizing that kind of thing