Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm in the same position, I think. I used to be a SOLIDhead but I find the adherence to SOLID increasingly off-putting.

Primarily code should do the thing simply and obviously. The best attribute of any code, in my view, is that it's easy to delete when the requirements change or you have to pivot. There are some fundamentals of good design when writing code (prefer immutability, minimise shared state) which help to make code easier to reason about but overeager application of SOLID or design patterns tends to result in the wrong abstractions that grow out of control when they need to be worked around because they don't fit.

If you write the code with YAGNI and KISS in mind any applicable pattern tends to become obvious over time.



I think SOLID is appropriate for the public interface parts of your code but the internals should strive for YAGNI/KISS.

So the vast majority of your codebase should aim to minimize lines of code and abstraction. Of course there are exceptions - sometimes you really do need to encapsulate complex sub-systems with abstractions but you should have a clear justification.


This is the conclusion I have reached, well put.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: