r/AskComputerScience • u/Tsoinami1224 • Jul 26 '19
How do you move your development environment, tools, etc when changing laptops?
I'm coming to the realization that I've invested nearly 50+ hours getting my dev environment perfect. From setting environment variables to proper installations of dozens of programs/tools. Any advice on how to maintain my dev environment when switching devices? Is it advisable to clone my setup to a drive? Or is it more professional/generally accepted to simply start fresh? I am using Windows 10, but welcome advice for *nix environments as well.
5
Jul 26 '19
Shove as much as you possibly can into automation and version control. Every one-off manual step is a recipe for error.
3
u/dr1fter Jul 26 '19
Make sure to distinguish between things that are really just for convenience in your dev environment (vimrc, for example), and configuration of various frameworks and build tools (installing all your libraries). The latter is part of your project and should be checked in to version control, and really should work in isolation instead of relying on global configs on every workstation (that could inadvertently be shared between multiple projects). I occasionally like to start from scratch to make sure all the setup dependencies are explicitly documented for new team members (and to make sure the setup steps haven't proliferated too much).
That's the important part. As for the convenience stuff (personal preferences you wouldn't share with your team anyways), my requirements tend to be pretty minimal -- I try to use only vim and command line tools instead of learning all the specialized applications for different programming domains -- so, just copy the vimrc & bashrc, and install anything else as needed.
2
1
u/MCPtz Jul 26 '19
Full backup and restore. Pay for software to do that. It's worth it. Even if you have to make them buy you an external SSD 1TB drive. Prefer some kind of backup on a NAS with RAID. The latter is pretty easy and cheap if you have to just force them to buy you one. They'll often times hear this question and IT will think, "How can we do this for the whole office?" and take 6 months to make something happen and get approval to buy it. In the mean time, if shit happens, what happens to you?
I use Virtual Machines and back those up daily (automated process), along side my base OS.
The process is documented to recreate the basic development environment VM should the worst happen. Basic VMs are saved in online storage and "released", aka "Software Development Kits" (SDK).
I mainly just use the one, but sometimes there are reasons to have other ones, e.g. customer support for customers who use our SDKs.
All source is in a source control repository.
Data files are stored on the cloud.
Documents are stored on the cloud and/or in some kind of online collaboration tool.
Being forced to switch my base operating system is why I only develop in VMs, when possible. Once bitten, forever fucking afraid of doing that again.
1
u/PanChickenDinner Jul 26 '19
50 hours? I think your best option is to simply your toolset.
/25 years in, windows enterprise development. Can setup a new workstation after windows in about 3 hours, not counting download times.
1
Jul 27 '19
I don't customize anything at all because I frequently switch machines, wipe hard drives, install new Linux distros...
16
u/paxswill Jul 26 '19
*nix side here. Most of my environment is configured through dotfiles that I keep in source control. If I’m modifying something, the change is made and committed so it can be easily pulled in on other machines. I’m not as good at automating the installation of tools, but it’s usually just a handful of core things (git, vim) with extra tools (specific compilers or interpreters) installed as needed (my dotfiles do a lot of checking during set up). The next step for me would probably be to start writing something like Ansible playbooks to live alongside the dotfiles for setting up the rest of the system.
If you want to see how other people approach this (again, mainly *nix based), check out repos tagged with “dotfiles” on GitHub. I’d recommend against jumping in and adding a bunch of stuff you think sounds useful. Adding smaller things, evaluating if they make your workflow better, and working from there helps to keep your stuff from getting bloated (at least for me).