▲ 342 ▼ What are your programming hot takes? (lemmy.ml) submitted 3 years ago by 257m@lemmy.ml to c/programming@programming.dev 894 comments fedilink hide all child comments
[–] million@lemmy.world 174 points 3 years ago* (8 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. permalink fedilink source hideshow 16 child comments replies: [–] NoXzema@lemmynsfw.com 46 points 3 years 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. permalink fedilink source parent [–] brettvitaz@programming.dev 30 points 3 years ago* (1 child) Only if the code base is well tested. Edit: always add tests when you change code that doesn’t have tests. permalink fedilink source parent hideshow 2 child comments replies: [–] mark@programming.dev 3 points 3 years ago And also try to make tests that don't have to change if you refactor in future (although there are some exceptions) permalink fedilink source parent [–] marcos@lemmy.world 13 points 3 years ago (2 children) Doesn't everybody agree with this? I really never thought of it as a hot take. permalink fedilink source parent hideshow 4 child comments replies: [–] Jakeroxs@sh.itjust.works 16 points 3 years ago (1 child) I highly doubt most corps do permalink fedilink source parent hideshow 2 child comments replies: [–] intelati@programming.dev 5 points 3 years ago (2 children) Corps != people. People just pass the buck and nobody stands up for what is most correct permalink fedilink source parent hideshow 4 child comments replies: [+] bob_wiley@lemmy.world 10 points 3 years ago* (last edited 2 years ago) (2 children) [deleted] permalink fedilink source parent hideshow 4 child comments replies: [–] Jakeroxs@sh.itjust.works 1 point 3 years ago This permalink fedilink source parent [–] intelati@programming.dev 1 point 3 years ago (1 child) Most calls I have at work are like group therapy sessions, as everyone has ideas of what they believe is correct, but they know if they keep pressing with management or take the time to do what is right, it won’t go well for them. This is coming from a guy who lasted a year and a half in the office. Sounds like it's a systematic issue.. permalink fedilink source parent hideshow 2 child comments replies: [+] bob_wiley@lemmy.world 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent [+] coltorl@programming.dev 1 point 3 years ago [deleted] permalink fedilink source parent [–] flumph@programming.dev 8 points 3 years 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. permalink fedilink source parent [–] Nomad@infosec.pub 8 points 3 years ago Our company motto is: "leave it cleaner than you found it" permalink fedilink source parent [–] myersguy@lemmy.simpl.website 3 points 3 years ago (1 child) Who is in the wrong? Your manager, for not giving you time to refactor? Or you for giving him the option? permalink fedilink source parent hideshow 2 child comments replies: [–] nous@programming.dev 8 points 3 years ago (1 child) 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. permalink fedilink source parent hideshow 2 child comments replies: [–] myersguy@lemmy.simpl.website 2 points 3 years ago I guess I need to refactor for readability. What you just explained is the entire point of the comment I posted. Refactoring is part of the job. Don't give your manager a choice on whether or not it needs done. permalink fedilink source parent [–] hascat@programming.dev 2 points 3 years ago Yes please. Many times when I add a feature I end up refactoring some of the code first to better accommodate it. permalink fedilink source parent [–] Random_user@lemmy.world 1 point 3 years ago thank_you_michael_scott.gif permalink fedilink source parent [–] russmatney@programming.dev 1 point 3 years ago We used to call this ‘Code is Cheap’ at my last job - you’re spot on about the value of it permalink fedilink source parent
[–] NoXzema@lemmynsfw.com 46 points 3 years 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. permalink fedilink source parent
[–] brettvitaz@programming.dev 30 points 3 years ago* (1 child) Only if the code base is well tested. Edit: always add tests when you change code that doesn’t have tests. permalink fedilink source parent hideshow 2 child comments replies: [–] mark@programming.dev 3 points 3 years ago And also try to make tests that don't have to change if you refactor in future (although there are some exceptions) permalink fedilink source parent
[–] mark@programming.dev 3 points 3 years ago And also try to make tests that don't have to change if you refactor in future (although there are some exceptions) permalink fedilink source parent
[–] marcos@lemmy.world 13 points 3 years ago (2 children) Doesn't everybody agree with this? I really never thought of it as a hot take. permalink fedilink source parent hideshow 4 child comments replies: [–] Jakeroxs@sh.itjust.works 16 points 3 years ago (1 child) I highly doubt most corps do permalink fedilink source parent hideshow 2 child comments replies: [–] intelati@programming.dev 5 points 3 years ago (2 children) Corps != people. People just pass the buck and nobody stands up for what is most correct permalink fedilink source parent hideshow 4 child comments replies: [+] bob_wiley@lemmy.world 10 points 3 years ago* (last edited 2 years ago) (2 children) [deleted] permalink fedilink source parent hideshow 4 child comments replies: [–] Jakeroxs@sh.itjust.works 1 point 3 years ago This permalink fedilink source parent [–] intelati@programming.dev 1 point 3 years ago (1 child) Most calls I have at work are like group therapy sessions, as everyone has ideas of what they believe is correct, but they know if they keep pressing with management or take the time to do what is right, it won’t go well for them. This is coming from a guy who lasted a year and a half in the office. Sounds like it's a systematic issue.. permalink fedilink source parent hideshow 2 child comments replies: [+] bob_wiley@lemmy.world 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent [+] coltorl@programming.dev 1 point 3 years ago [deleted] permalink fedilink source parent [–] flumph@programming.dev 8 points 3 years 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. permalink fedilink source parent
[–] Jakeroxs@sh.itjust.works 16 points 3 years ago (1 child) I highly doubt most corps do permalink fedilink source parent hideshow 2 child comments replies: [–] intelati@programming.dev 5 points 3 years ago (2 children) Corps != people. People just pass the buck and nobody stands up for what is most correct permalink fedilink source parent hideshow 4 child comments replies: [+] bob_wiley@lemmy.world 10 points 3 years ago* (last edited 2 years ago) (2 children) [deleted] permalink fedilink source parent hideshow 4 child comments replies: [–] Jakeroxs@sh.itjust.works 1 point 3 years ago This permalink fedilink source parent [–] intelati@programming.dev 1 point 3 years ago (1 child) Most calls I have at work are like group therapy sessions, as everyone has ideas of what they believe is correct, but they know if they keep pressing with management or take the time to do what is right, it won’t go well for them. This is coming from a guy who lasted a year and a half in the office. Sounds like it's a systematic issue.. permalink fedilink source parent hideshow 2 child comments replies: [+] bob_wiley@lemmy.world 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent [+] coltorl@programming.dev 1 point 3 years ago [deleted] permalink fedilink source parent
[–] intelati@programming.dev 5 points 3 years ago (2 children) Corps != people. People just pass the buck and nobody stands up for what is most correct permalink fedilink source parent hideshow 4 child comments replies: [+] bob_wiley@lemmy.world 10 points 3 years ago* (last edited 2 years ago) (2 children) [deleted] permalink fedilink source parent hideshow 4 child comments replies: [–] Jakeroxs@sh.itjust.works 1 point 3 years ago This permalink fedilink source parent [–] intelati@programming.dev 1 point 3 years ago (1 child) Most calls I have at work are like group therapy sessions, as everyone has ideas of what they believe is correct, but they know if they keep pressing with management or take the time to do what is right, it won’t go well for them. This is coming from a guy who lasted a year and a half in the office. Sounds like it's a systematic issue.. permalink fedilink source parent hideshow 2 child comments replies: [+] bob_wiley@lemmy.world 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent [+] coltorl@programming.dev 1 point 3 years ago [deleted] permalink fedilink source parent
[+] bob_wiley@lemmy.world 10 points 3 years ago* (last edited 2 years ago) (2 children) [deleted] permalink fedilink source parent hideshow 4 child comments replies: [–] Jakeroxs@sh.itjust.works 1 point 3 years ago This permalink fedilink source parent [–] intelati@programming.dev 1 point 3 years ago (1 child) Most calls I have at work are like group therapy sessions, as everyone has ideas of what they believe is correct, but they know if they keep pressing with management or take the time to do what is right, it won’t go well for them. This is coming from a guy who lasted a year and a half in the office. Sounds like it's a systematic issue.. permalink fedilink source parent hideshow 2 child comments replies: [+] bob_wiley@lemmy.world 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent
[–] intelati@programming.dev 1 point 3 years ago (1 child) Most calls I have at work are like group therapy sessions, as everyone has ideas of what they believe is correct, but they know if they keep pressing with management or take the time to do what is right, it won’t go well for them. This is coming from a guy who lasted a year and a half in the office. Sounds like it's a systematic issue.. permalink fedilink source parent hideshow 2 child comments replies: [+] bob_wiley@lemmy.world 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent
[+] bob_wiley@lemmy.world 2 points 3 years ago* (last edited 2 years ago) [deleted] permalink fedilink source parent
[–] flumph@programming.dev 8 points 3 years 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. permalink fedilink source parent
[–] Nomad@infosec.pub 8 points 3 years ago Our company motto is: "leave it cleaner than you found it" permalink fedilink source parent
[–] myersguy@lemmy.simpl.website 3 points 3 years ago (1 child) Who is in the wrong? Your manager, for not giving you time to refactor? Or you for giving him the option? permalink fedilink source parent hideshow 2 child comments replies: [–] nous@programming.dev 8 points 3 years ago (1 child) 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. permalink fedilink source parent hideshow 2 child comments replies: [–] myersguy@lemmy.simpl.website 2 points 3 years ago I guess I need to refactor for readability. What you just explained is the entire point of the comment I posted. Refactoring is part of the job. Don't give your manager a choice on whether or not it needs done. permalink fedilink source parent
[–] nous@programming.dev 8 points 3 years ago (1 child) 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. permalink fedilink source parent hideshow 2 child comments replies: [–] myersguy@lemmy.simpl.website 2 points 3 years ago I guess I need to refactor for readability. What you just explained is the entire point of the comment I posted. Refactoring is part of the job. Don't give your manager a choice on whether or not it needs done. permalink fedilink source parent
[–] myersguy@lemmy.simpl.website 2 points 3 years ago I guess I need to refactor for readability. What you just explained is the entire point of the comment I posted. Refactoring is part of the job. Don't give your manager a choice on whether or not it needs done. permalink fedilink source parent
[–] hascat@programming.dev 2 points 3 years ago Yes please. Many times when I add a feature I end up refactoring some of the code first to better accommodate it. permalink fedilink source parent
[–] Random_user@lemmy.world 1 point 3 years ago thank_you_michael_scott.gif permalink fedilink source parent
[–] russmatney@programming.dev 1 point 3 years ago We used to call this ‘Code is Cheap’ at my last job - you’re spot on about the value of it permalink fedilink source parent