Adventures in code
Lessons learned : keeping it safe
Anyone working with code (or anything digital) sooner or later will learn several things :
- backups are your friends
- version control is really useful
- always backup your code
- it’s good to have a backup
Lesson 1 : always have a backup
My first program was lost, because my computer died and took its hard drive with it.
So lesson learned I thought and got myself a fancy external hard disk. Until one day that thing just died …
So now I got a NAS (network attached storage) with multiple disks … and I’m safe, right ?
Wrong … the hard disks in those things can still die (which happened to me), but at least you’ve got a chance to recover. Just make sure you’ve got a spare harddisk when it does.
In ye olden days there were things like tape drives for storing backups.
Us modern folks can use writabel dvd’s instead.
And for extra security (and piece of mind) you keep such backups off-site so you can still recover should your house suffer a catastrophic disaster of some kind. Best not to think about such things, but your sanity will thank you if you do should the proverbial excrement hit the spinning blade.
Lesson 2 : version control
In ye olden days version control was something that wasn’t available to mere mortals. The best you could do is make a backup at regular intervals.
These days it’s easier for us code monkeys, because the required tools are free.
Trust me … once you’ve learned what version control software can do you never ever want to go back.
There are multiple variants, but the two big ones are :
- Team Foundation Version Control
This is what Microsoft thinks is what ‘version control’ should be.
It is big, clunky but it works and is perfectly integrated into Visual Studio (the development environment from Microsoft). - Git
This has its roots in the Linux community.
TFVC has one advantage over Git and that it can do more than do version control. It also acts as a manager for your project. However the added complexity is not worth it for us mortals. It is very useful if you do a 100% Microsoft project using all of their tools.
You may have heard that Microsoft bought GitHub.
That is not Git itself (which is the version control software), but merely a service provider that hosts Git repositories. There are others ( BitBucket by Atlassian is one of them). One thing to keep in mind is that projects on GitHub are public by default. The ones hosted on Atlassian/Bitbucket are private by default. These are the limitations of getting to use such services for free.If you’ve got a NAS then chances are you’ve seen Git as a service to install.If you really value your privacy then that may be the way to go.
There are some pretty big differences in how TFVC and Git function as version control. Suffice to say is that switching from one to the other isn’t something that is easily done. If you’re learning then getting to know Git may be the best way forward, because a lot of the open source projects are hosted as Git repositories.
The topic of version control is too big to discuss and explain in this project, so you’re going to want to Google it yourself. The only thing I can say is that I prefer to use SourceTree instead of Visual Studio when dealing with Git repos. MS probably has improved a lot, so you may want to test this yourself.
Useful websites and tools
All of these tools and services are free to use, but they do have some (minor) restrictions that are worth checking out before you commit to any of them.
One thing worth mentioning is that ‘Visual Studio (Community)’ and ‘Visual Studio Code’ are two different environments. Blame Microsoft for making this extra confusing.
Leave a Reply