this post was submitted on 15 Oct 2024
256 points (99.6% liked)

Programming

17189 readers
640 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 1 year ago
MODERATORS
(page 2) 19 comments
sorted by: hot top controversial new old
[–] Bishma@discuss.tchncs.de 29 points 1 day ago

So, roughly 20% of developers have found the right mix of self-medication?

[–] actually@lemmy.world 20 points 1 day ago (3 children)

I’ve been programming for years, I’ve only happy when working on my own stuff. It’s like the difference between renting and owning

load more comments (3 replies)
[–] count_dongulus@lemmy.world 14 points 1 day ago* (last edited 1 day ago) (5 children)

The thing that frustrates me about developers who feel powerless over technical debt is...who is actually stopping them from dealing with it? They way I see it, as a software engineer, your customer is sales/marketing/product/etc. They don't care about the details or maintenance, they just want the thing. And that's okay. But you have to include the cost of managing technical debt into the line items the customer wants. That is, estimate based on doing the right things, not taking shortcuts. Your customer isn't reading your commits. If they were, they wouldn't need you.

It would be bizarre if your quote for getting your house siding redone included line items for changing the oil on the work truck, organizing the shop, or training new crew members. But those costs of business are already factored into what you pay at the end of the day.

[–] AdamBomb@lemmy.sdf.org 12 points 1 day ago (1 children)

Yes, this. Refactor first to make the upcoming change easier and cleaner, not after. Don’t ask for permission, don’t even call it refactoring or cleanup. Just call it working on the feature, because that’s what it is. Don’t let non-engineers tell you how to engineer.

[–] catalyst@lemmy.world 5 points 1 day ago (2 children)

Yes, this! I rarely ask for permission on that sort of thing. I’ll just do it as part of my work and see if anyone calls me out on it.

[–] TrickDacy@lemmy.world 3 points 21 hours ago (1 children)

I do this too, but I realize I'm privileged to be able to. In past jobs people actually would get pissed at me for doing it. I had a manager have a really shitty talk with me about it once. I'd guess a lot of people have bad experiences like that

[–] FlorianSimon@sh.itjust.works 3 points 19 hours ago* (last edited 18 hours ago)

If higher-ups complain about intempestive code refactoring, it's always a good idea to stop for a moment and to start becoming less trigger-happy with refactors. It's OK to take some time to determine what actual value refactors bring to the project in tangible terms - intuition is not enough. Convincing a critical manager is a good start, because their tolerance for programmer bullshit is low if they don't actually write code.

Very often, and this is especially prevalent among junior programmers who care about what they do, the reasoning for refactoring turns out to be something along the lines of "I don't like this" or "I read some cool blog article saying things should be done that way", without any care about whether or not the change in question is actually improving anything, or, if it does, if the improvement is worth the degradation in terms of quality (new bugs)/maintainability (added genericity making the code more difficult to understand, cryptic features of the language being used that make it hard to understand what's going on, I'm sure there's other examples...)

[–] FlorianSimon@sh.itjust.works 1 points 19 hours ago* (last edited 18 hours ago) (1 children)

The problem is you often get in cases where the developer cannot back their intuition that something is actually harmful with facts. When it's not just pure bikeshedding about code they don't like and falsely claim to be a ticking timebomb, they fail to weigh the risks of leaving slightly offputting code in the codebase against the risks associated with significant code changes in general, which, even with tests, will still inevitably break.

Developers of all sorts tend to vastly overestimate how dangerous a piece of code may be.

To be clear, while I've seen it with other developers, I'm still guilty of this myself to this day. I'm not saying I'm any better than anybody.

It's just that I've seen how disruptive refactoring can be, and, while it is often necessary, I thought it would be important to mention that I think it should be done with care.

If you can convince a manager with rational arguments in terms of product quality, it can be a good way to make the case for a refactor, because your manager probably won't be impressed by arguments about unimportant nuances we developers obsess about.

[–] 0x0@programming.dev 1 points 15 hours ago

The joy begins when you know you should refactor the whole project from the ground up...

[–] janAkali@lemmy.one 6 points 22 hours ago (1 children)

I believe for many companies, developers work on giant codebases with many hundred thousands or even millions of lines of code.

With such large codebase you have no control over any system. Because control is split between groups of devs.

If you want to refactor a single subsystem it would take coordination of all groups working on that part and will halt development, probably for months. But first you have to convince all the management people, that refactor is needed, that on itself could take eternity.

So instead you patch it on your end and call it a day.

load more comments (1 replies)
load more comments (3 replies)
load more comments
view more: ‹ prev next ›