68
you are viewing a single comment's thread
view the rest of the comments
[-] masterspace@lemmy.ca 15 points 4 days ago* (last edited 2 days ago)

+++ I cannot stress this enough.

Programmers tend to get over obsessive about DRY code because it seems like it should be easier to maintain fewer functions and writing less code should be easier right? But it tends to ignore the actual subtle differences between the different consumers of that abstraction, and that leads to massively branching functions that couple unrelated parts of the codebase together. These then become impossible to read and change without worrying about breaking something else.

When I was at Thoughtworks (Martin Fowler's current company), we were also taught the rule of three for refactoring, and were taught to always optimize your code for readability and maintainability first and foremost. Refactoring and improving easy to read/maintain code is always relatively trivial, by nature of it being clear, concise and decoupled, and that can be done once you have a reason to do so (i.e. performance issue etc), so there's no point over optimizing for anything else up front.

This talk from Dan Abramov (one of the lead devs of React) does a really really good job explaining some of these issues and is entirely worth the full watch/listen (do it on company time, it's professional development):

https://www.deconstructconf.com/2019/dan-abramov-the-wet-codebasets

this post was submitted on 10 Oct 2025
68 points (97.2% liked)

Programming

23074 readers
263 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS