4 ms·
Going in with this attitude is not good at all. I'd say don't become obsessed with DRY, because in the beginning it often won't be clear when it's appropriate t
by dmethvin 16y ago
Going in with this attitude is not good at all. I'd say don't become obsessed with DRY, because in the beginning it often won't be clear when it's appropriate to "fork" portions of the code versus adding a branch or two to the core logic. But if you go in with the idea that copy/pasta is the way to write code then you'll have important logic spread across dozens of places and it will become a nightmare to make what should be a simple change.
- jhen095 16y agoI agree. Balance is key here. A bit of DRY to keep things tidy and a bit of copy/paste to get things moving and working as quick as possible. The company I work for has been very much anti-DRY. They copy and paste pretty much everything and have quickly brought a working product to the table. Funnily enough the code base is HUGE. Me, however, new to the company and fresh out of University have been fighting the good fight and trying to introduce DRY. However this slows down development as I refactor, and can sometimes break existing stuff while merging two inconsistent branches. So I have learnt to pick my battles. There is a balance. Don't fix what ain't broke and if copy/paste will get things moving along, do not hesitate.