|
"some are just laziness on the part of some programmer"
your post is excellent advice and I suspect you have scars
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Michael Feathers wrote a great book "Working with Legacy Code" for exactly this.
Step 1: wrap anything you are going to change in tests so you know what it does now and can ensure it continues to do that after your changes...
Step 2...whatever is necessary to fix problems you are having.
The strangler fig pattern can be helpful - gradually wrap/replace sections until the whole codebase has been replaced, like a strangler fig strangling a tree.
Ian
|
|
|
|
|
Thanks for the book reference.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
yeah, what he said. I was lazy and didn't bother to scroll to the bottom.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Changing pointers to references may have very interesting consequences. Before I'd be making API changes like that, I would want a solid set of test cases to prove I hadn't broken anything.
<sigh> - glancing at project on new laptop with 20 year old mfc code and limited comments.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Where I work that would be cost prohibitive, because of the amount of V,V & T involved.
~d~
|
|
|
|
|
ah yes IVV. The best job I despised.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Code does not rot. If it works it works. Only when it has or need to be interfaced with something new, does it need a rewrite. And by then he it may be better to write the function from scratch. Time is life. Are you willing to exchange life, yours or someone else, in order to change something that works for something that may or not work?
That said in the rare occasions. Make sure you understand the requirements and don't go into change for the sake on change.Then change what needs to be changed.
|
|
|
|
|
Thanks.
I don't think I want to change old code for the sake of change.
I just want to make it possible to steer the team towards better/modern coding practice.
Especially for new code or code that needs maintenance.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
First off, I'm not a Linux fanboi. I like to tinker with it, I've played with countless distributions, both mainstream and obscure, and have built more Linux VMs than I can remember.
For the first time ever, I'm doing an in-place upgrade right now, of Debian 11 to Debian 12, on a system I'm actually using (hosting Pi-Hole - and that's it). About a total of 8 commands, waiting, a reboot, then all good to go. Actually I'm not sure a reboot will even be necessary; I'm currently still on the waiting phase as packages are being installed...
I don't know, I can't quantify it--but I can't shake the feeling that an in-place Linux upgrade leaves the system in much better shape than an in-place Windows upgrade has ever been able to do.
Maybe it's the placebo effect. But I always feel dirty upgrading Windows, in that there's probably gigabytes worth of crap the upgrade leaves behind, that Windows has no means of thoroughly cleaning up. Yes, it keeps a WINDOWS.OLD folder, and yes, it will eventually delete it on its own over time...but it still leaves me with a nasty feeling that Linux doesn't. It's not just the disk space, but probably some stuff left running, or badly configured, that can only be avoided by wiping/repaving.
After many bad experiences over the decades, I always do clean installs of Windows. I just can't bring myself to fully trust it, even if the upgrade is entirely successful.
Am I imagining things? Is Linux truly more apt (pardon the pun) to do a better job of not leaving unnecessary crap behind?
|
|
|
|
|
well both are two different cases.. and there are differences
Caveat Emptor.
"Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long
|
|
|
|
|
So...there's some merit to my assertion?
|
|
|
|
|
There is merit to it. Don't hold your breath to find too many Linux experts on CP tho.
Jeremy Falcon
|
|
|
|
|
There's a few of us.
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
I can't remember the last time I did a full, clean install of windows - it was generations ago, possibly Win XP ...
And I don't really have problems: 11 installed OK on both desktop and Surface (and didn't take up much extra space on the Surface).
It's certainly a whole load quicker and easier than reinstalling all my apps (once I've found the licences, and persuaded them to accept it's the same computer again) and getting things back to the way I like them (which always feels "off" for a couple of weeks for reasons I can't detect by which niggle at me anyway).
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Maybe I should follow that advice and trust the Windows installer after all.
You'd think I'd have the process down to a tee by now, and I'd be able to get back to a "normal" state fairly quickly after rebuilding something from scratch so many times, but no...no, I don't.
Heck right now I'm dealing with a machine, freshly built back in June, that has NOT been able to download/install the monthly CUs from day one. Just some obscure error message, and none of the articles I've seen can clear it up. Every month I'm hoping that'll be the one to sort things out, but no, it always gets stuck despite doing all the resets, clearing caches, etc. At some point I'm just going to nuke it all over again.
|
|
|
|
|
dandy72 wrote: Maybe I should follow that advice and trust the Windows installer after all. Don't. Windows does leave behind crap. It also uses way more disk space so you can revert. Yes, you can delete it, but it's never quite as clean. Granted, that don't mean the OS won't "work".
Back in the day, the biggest issue was NTFS sucked with fragmentation issues. It's better about that these days. And while you can defrag your page file, etc. and upgrade to dance around this, you'll still have artifacts on your system.
Point is, a clean install is always mo better. Yes you have to re-install software, but that's like what... once every 3-4 years? Not like that's a big deal.
Jeremy Falcon
|
|
|
|
|
OriginalGriff wrote: it was generations ago, possibly Win XP Time to upgrade your machine.
Jeremy Falcon
|
|
|
|
|
Oh I have - there isn't a single part that was in it a few years ago ... I migrated my HDD to SSD (thanks AOMEI!) and that was the hardest part.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Do you call it "ship of Theseus"?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
Theseus' PC:
Totally original except bought running Win XP, now on Win 11, upgraded memory, SSD instead of HDD, new motherboard and CPU (needed for TPM for Win 11), replacement power supply (and case), better graphics card, OLED screen replaced CRT monitor, wireless mouse & keyboard instead of wired versions.
|
|
|
|
|
Yep, except I also replaced the case, and the mains lead.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Trigger's broom? Grandad's hammer?
|
|
|
|
|
Same here. I was running my original WinXP installation from when it first came out to 2017, when after multiple Windows upgrades and image moves (with AOMEI, etc.) to hard drives and SSDs, I was forced to do a clean install after repeated refusals to install Win10 botched up my installation. Almost 17 years with the original installation.
|
|
|
|
|
Wait! So you're saying you have a desktop that came with Windows XP (or you did a fresh install of XP on it) and since then (circa 2008?) you've done numerous hardware updates (replacing nearly everything?) yet you've only ever performed Windows updates to reach a modern version (Win 10 or 11)?
That's pretty wild.
|
|
|
|