this post was submitted on 01 Sep 2023
13 points (100.0% liked)

Programming

17756 readers
486 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
you are viewing a single comment's thread
view the rest of the comments
[–] million@lemmy.world 7 points 1 year ago* (last edited 1 year ago) (4 children)

Refactoring is something that should be constantly done in a code base, for every story. As soon as people get scared about changing things the codebase is on the road to being legacy.

[–] NoXzema@lemmynsfw.com 1 points 1 year ago

Been with a lot of codebases that had no unit tests at all and everyone was afraid to change anything because the QA process could take weeks to months.

The result is you have a codebase that ages like milk.

[–] marcos@lemmy.world 0 points 1 year ago (1 children)

Doesn't everybody agree with this? I really never thought of it as a hot take.

[–] flumph@programming.dev 1 points 1 year ago

Today I removed code from a codebase that was added in 2021 and never ever used. Sadly, some people are as content to litter in their repo as they are in the woods.

[–] myersguy@lemmy.simpl.website 0 points 1 year ago (1 children)

Who is in the wrong? Your manager, for not giving you time to refactor? Or you for giving him the option?

[–] nous@programming.dev 1 points 1 year ago

Why do you need time to refactor? It is just part of the work you need to do and should be accounted for when doing any other work. IMO a big mistake people make is thinking refactoring is some separate thing they need permission to do. You don't, if you need to make a change in some area refactor it first to make it easier to accept your change, then add your change then refactor to clean up. This is not three separate tasks, just three steps in one task. You should be given enough time to do the whole task, not just part of it.

[–] brettvitaz@programming.dev -1 points 1 year ago* (last edited 1 year ago)

Only if the code base is well tested.

Edit: always add tests when you change code that doesn’t have tests.