So many people want to learn to program these days, so I feel more inclined to share what I've learned about programming over the years.
Early in my career I came up with a motto: discontinuities suck.
It's an idea that's borrowed from calculus, which is the study of continuous functions. A discontinuity occurs at a point where a function has no derivative. I'm amazed I still remember that. I was not a great math major, but that's what I was and some of it sunk in. I guess.
Anyway in programming, you try to avoid discontinuities.
But if you can't you create a safety net by taking a backup before you start a project, no matter how small. I do this these days by making it very easy to do one. I just choose a menu command. A second later I'm backed up.
Being backed up means if you get out on a limb and it breaks, instead of having to run the shattered version of the software, you can quickly go back to the last version that worked.
Now you make a change, and maybe another, and test at every step, and still you will release new code that's broken. Stuff that used to work no longer works.
The thing you try to avoid is making a huge change to an app, something I used to think of as a brain transplant, but now call a corner-turn, a move that's so risky that you're likely to have users seeing something broken while you try to fix it in realtime. A discontinuity. You think this doesn't happen to everyone? It does. Some companies like Apple, ship broken operating systems so consistently that people identify themselves by how much breakage they're prepared to endure. My own tolerance is very low. I honestly don't think OSes are worth upgrading. They don't change enough in useful ways to endure the pain of using a system that has a broken feature that you depend on. Microsoft is even worse these days. They try grand experiments like removing the Start menu. I can't imagine what they were thinking. Totally amateur product evolution. A crazy person designed Windows 9, I'm convinced.
Anyway, I had a big corner-turn to make, and decided to do it over the Thanksgiving weekend. That way if everything broke, at least people would feel they had something better to fall back on, like bingeing on The Wire or Orange is the New Black. And in fact, I did break it. And am right now waiting for the software to die again, this time with some new instrumentation in it, so I can possibly better observe the failure!
I do believe I have a good backup, and if I can't figure out what the problem is, I can revert, and Monday morning be running the tried-and-true version of the server. But I actually expect I will debug this, and we'll have turned the corner, and be ready for some new breakage! Hah. It really is a dark art, programming.
I like to think I get better at programming, but maybe I don't really. I haven't figured out how to avoid these critical sections, yet.
Still diggin!
PS: Programmers often type "borked" instead of "broken." It's because for some reason your mind wants to type the word that way, and rather than back up and fix it, you just leave it alone. In every instance in this piece where I typed broken it started as bork instead. Because I care about the English language, I fixed it, instead of being cute.
PPS: A few hours later, I found two problems. One of them probably was the reason the server would crap out after 50 minutes or so. Feeling kind of confident in this corner-turn.
PPPS: Update on Monday morning. The server seems to be running well.
If the software writes the data differently then the data should also be backed up.
Yes, very true. And to play it safe backup the data even if you're fairly sure the format didn't change.