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

Generally, I never think in terms of writing "DRY" code. I think the presumption of re-usability is a primary reason.

I architected a React.js framework that needed to exist in our existing portal environment and play well with all of the other frameworks and scripts. My solution was tightly coupling bundles of code for widgets deployed on my platform. I have conventions all devs need to follow and it does result in not very dry code.

The benefit is that everyone can work independently and not affect each other. Testing is easier to do as there are less logic paths. Performance is still optimized with code-splitting, so the extra code really doesn't affect performance.

Whenever people try to create a DRY one-size-fits-all solution, I find them very inflexible and prone to breaking. Add to that, they are generally poorly documented, so making changes can be very stressful.



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

Search: