My mac air just fsck'd up, and I had to reinstall - lessons learned
My current setup is a Macbook Air, which unfortunately started acting up a day ago. The hard drive, an SSD, for some reason started to have disk errors. I was forced to learn how to use Command + S to run single-user mode in an instant, and discovering
fsck (a command line tool that is used to check and repair a linux system. I don't know why it is named that way, and it would make an interesting title, harhar)
For a while, I was putting off totally wiping clean and doing a factory reset. I wanted to backup as much as files as possible. I finally did it and I'm happy - less data on my disks, means I was able to finally update to Catalina (I know, it was released almost a year ago, unfortunately prior to this my disk didn't have enough space to install it, until this happened).
For a long time, I had never thought I'd run into an issue and didn't back up my files. I somehow disconnected my Dropbox after feeling it was not necessary since most of my codes are on a repo somewhere, and documents - photos, music and what are all on the cloud anyway (with Spotify, Google Photos and all, we practically don't need to do backups like we used to way back when).
Think cattle, not pets
This is the main lesson here. I learned about this mantra eons ago, when docker and devops was always on the news. My lesson on this is to DC (DisConnect) or not feel too emotionally attached to the machine. Yes, it's expensive, yes - as it's a mac, you shouldn't normally run into a lot of issues on maintaining it. But it is what is - just an ephemeral machine which can slow down, have problems just like everyday things that suffer from wear and tear.
With this thinking, my first lesson is:
Make it should be a habit. New file downloaded? Do you need it later? Back it up! Any Photos you want to see in the future, when you're a little older and want to reminisce on some memories? Back it up! Not sure? Put into a temporary folder and every week, review what's in the temporary folder and Marie Condo it.
The second lesson is, as a dev, you should have a DEV SERVER.
The DEV SERVER can act as a backup. But the idea is, instead of developing locally all the time, put all your codes on the server! It's also useful if you have another machine you work from, all you have to do is to access your dev server. If AWS/DigitalOcean/Azure machines are too expensive for you, maybe look into getting a cheap servers from Low End Box. OR, if your company is fine with it, ask IT to provision a server for your work.
Also another way to do this is to try out Amazon Workspaces, a Desktop-as-a-service solution. It's not cheap, but I'm considering it, since the idea is as computers become ubiquitous (and more ephemeral, imho), while you can use low-power machines and just connect to the "super computers" on the cloud. It's also a bit complicated, needing to setup a VPC and an Active Directory. But if your company provides it, then awesome!
My third lesson in all this is pretty basic. Backup your passwords. With Google Chrome's sync features and tools like LastPass, 1Password, Roboform, Dashlane, etcetera, it's not that hard to create an account with them.
So, basically, try not to be too caught-up about your machine breaking. At the back of your mind, remind yourself, what happens if this thing breaks. So "Think cattle, not pets". Your machine is not a pet, it's just like cattle - a tool that can break. It is fragile. It can even blow up tomorrow. Are you prepared?