views:

363

answers:

8

Casus:

How to edit and advance with the same code, from several distanced locations and computers as easily as possible?

I have this thought for some time now. I am regularly having problems when I have to work on one project from different computers, as I have not taken any measures or whatsoever to ease myself in this situation. That is partially due to the fact that I rarely do freelance projects and they are normally small web sites.

Imagine that you need to work on a project at home, where you have setup database, webserver, phpmyadmin and everything you'll need to get your app running. Then you go to your girlfriend's house for the weekend but you need to advance with the project and during that time you want to do some coding.

What I am currently doing is that I am archiving my whole project, along with a DB dump usually and place it on a ftp host, so that I may access it later when I need it. I probably don't have to explain how tedious this might be, especially if you need to setup the whole environment on the PC you are currently being at.

Considerations:

  • Turn my home PC into a dev server with Remote Desktop enabled - the problem with this is that remote connection is not always fast and snippy as one would need it to be in order to do RAD. Also that implies the PC must be always be turned on at home, regardless that I might not even need it, If say, there are better things to do during the weekend. I might need to buy an UPS, as power outages happen from time to time around here.. I already don't like this solution.

  • Create database and SVN repositories at public hosting service and checkout code. This still has some of the problems, as you might need to install software, SVN client and eventually edit some configuration each time you change the computer. Oh, and as with the previous 'solution' - you are totally dependent on Internet access.

  • Buy an Eee PC and carry it around - that way you can have all of your environment with you. No network required as well. You have to drag the darn thing around tho, and even it is small, it is not something you might fit in your pocket. I also consider that these EEE PC's aren't very suitable for normal coding (small keyboard, screen, etc).

  • And finally, I have been thinking of an ideal scenario, where I have one of those linux distributions which go along a single CD or even a flashdrive. On the latest you can have all your environment always with you along with all the projects. You can fit it in your pocket. Nova days all computers have built-in USB ports, contrary not every computer has a CD ROM in place.

Thinking about it, I consider the last solution to be optimal and completely satisfying. Problem is, I am not very linux savvy and I haven't been messing with it so much. Especially with flashdrive OS.

Bottom line questions:

  1. Do you agree that a flashdrive is an optimal solution? Is there a better practice I can put into work? Perhaps I should reconsider this way of working at all?:)
  2. Do you think a flashdrive OS as say http://www.pendrivelinux.com/ is suitable for such web development environment at all; Are there better candidates for an OS?
  3. Are there any problems with booting from USB generally? Naturally I guess this shouldn't be a problem on most PC's?
  4. What is your personal experience in working from several locations on the same project?
+3  A: 

You really should just get a laptop and do all your coding on that machine. Messing around with netbooks and/or thumbdrives is not a long-term solution. I have a MacBook that I use to do all my coding. When I'm home, it's attached to a 21-inch monitor and a full keyboard and mouse. When I need to travel I unplug all the cords and put it in my bag. Since I use the same machine, I don't have to worry about migrating files or settings back and forth, and while the screen is somewhat small, it's not bad to get a bit of work done on the go.

If I couldn't carry my laptop around, I'd set up a development environment on a Linux server. However, this solution is highly dependent on the type of development you're doing and how familiar you are with Linux and the command line. I definitely don't recommend it for those that are starting out. However, with Screen and Emacs (or vim if you swing that way) you can have a fully-fledged development environment anywhere with internet access.

Kyle Cronin
Carrying around a laptop is not a solution for me - it is too heavy, too big to always carry with you - I've tried it. Eventually you end with the same situation - you don't have your laptop with you at your girlfriend and you need to sit down on her PC and use the FTP-archive tedious method.
Petrunov
@Petrunov: I've had a MacBook Air and VAIO Z and both of them are usable as dev machines and are not much heavier than netbooks.
Mehrdad Afshari
@Mehrdad Indeed. If you really want to get work done remotely you'll find a way to bring a laptop. Everything else has compromises.
Kyle Cronin
Sorry, I missed the point about a MacBook being lighter - that might be good and certainly expensive. If you are in a situation like I am - where you need that from time to time and it's not really super important, you wouldn't go for it.
Petrunov
A: 

I think SSH is the answer to everything. It gives me total control of my server regardless of my location, and it allows me to not only access a shell, but also upload and download files, as well as use port forwarding.

If I only need to do a few quick adjustments, I generally just SSH to the server and use nano or something similar to do the editing. Combined with screen it can actually be a surprisingly productive environment.

When I need to do more serious work I'll download notepad++ (free) and expandrive (windows equivalent for sshfs, 30day demo available). This allows me to remotely edit the files like they existed on my local harddrive (although it requires a good connection). Very productive. :)

Emil H
This makes you dependent on Internet connection, and sometimes there are limitations - proxies, that prevent the connection and such. Also it has some of the drawbacks of using Remote desktop - like I need to have a server up and running in my home - sometimes I tend to not return for days and not need it - really inefficient if you do as I do :(
Petrunov
A: 

Simple answer: a laptop. Yeah, it's not tiny like a cellphone... but it makes your coding like so much easier.

JRL
Fine, but it'll still be easier than the other methods. Buy a laptop and leave it at your girlfriend's if you don't want to carry it around ;-)
JRL
Big, heavy and expensive to always carry it with you :(
Petrunov
+9  A: 

Here's an alternate solution: carry a portable hard drive that has a portable installation of a virtual machine player and a virtual machine with all the dev tools you need. Just plug this into whatever computers are available, fire up the VM, put it in fullscreen mode and you're good to go. Carries the advantage of not having to mess with live-cd or live-usb Linux setup, especially since you stated you're not very familiar with Linux.

EDIT: you could also run your VM off a flash drive, though performance would be abysmal.

pyrochild
+1 Neat idea I haven't thought about trying that. Would it be possible to set up as an ASP.NET development environment also with windows or is it just for linux?
Ian Roke
Virtual machines can have virtually (haha) any OS installed on them. There may be some installation issues that a quick Google search can help you work around with some OSs (Virtual PC 2007 doesn't like Ubuntu very much), but Windows generally works with 0 effort, assuming it's an x86 VM.
pyrochild
You'd have VMware player or Sun Virtual Box for Linux, Windows and OS X and an image of your ASP.NET Windows VM. It'd work everywhere.
Mehrdad Afshari
The one caveat is that unless you plan to do all your work in the VM, you'll still need a process in place to transfer work and settings back and forth from your main development environment to the VM.
Kyle Cronin
@nobody_: true, but I believe it's actually fairly common for developers to do exactly that. I know I do.
pyrochild
uh, by "exactly that" I meant doing all work in a VM, not having a process to transfer work and settings back and forth... :D
pyrochild
That is the solution I am going for, definitely. Thank you very much gentleman. :)
Petrunov
Glad to help ^_^
pyrochild
+2  A: 

Laptop: Too expensive, keyboard too small, annoying to code on.

Remoting a desktop: You'll feel the lag, even fraction of seconds, and you'll go nuts after a day.

SVN: Too much trouble always needing to install the same softwares (repository client, FTP, text editor, mysql, etc) everywhere.

My solution is one that I use personally...USB Flash drive!

Install the portable version of all your softwares. I've managed to find a portable version of everything I needed:

Kitty (SSH)

Filezilla (SFTP)

USBWebserver (Apache 2, PHP 5, Mysql 5, PHPMyAdmin)

Notepad++ 5, Eclipse PDT (PHP IDE)

SNES9X (snes emulator) ;)

Keepass (password encryptor database thing)

HeidiSQL (similar to PHPMyAdmin)

Menu (a little system tray menu thing)

Directory of all my projects/music/notes

Here's a good link where I've found most of my softwares.

P.S. Works on windows and Linux (via wine). I've also put a autorun ini file on it, so when I plug it in, my System tray menu program runs and apache/mysql starts.

Mario
+1  A: 

How about a netbook? I heard the likes of Scott Hanselman using one with good effect to run Visual Studio and SQL Server for ASP.NET development so I am sure they would be powerful enough for your demands.

The screen size might be a limitation but at the great advantage of a smaller, lighter unit. The Asus Eee 901 has been recommended by a couple of people I work with.

Ian Roke
+1  A: 

I use Dropbox for code projects which are not security-dependant.

As for a development environment, my needs are minimal, so a copy of Notepad++ usually suffices. Currently this is installed locally on each machine I use, but I have toyed with the idea ofusing a portable installation on a USB drive.

Your needs are rather more complex than mine, however, and it seems to me that a laptop as suggested may be your best option

fearoffours
Eclipse has a portable version called PDT if you ever need more than notepad++
Mario
+1  A: 

I think a developers computer is like a bathing suit. You are very aware when the one you are using is not yours. Additionally, as we all know, there is a high degree of probability that any computer we find will have one of a thousand issues that will impact our assumptions and the consistent success of our USB/VM options. I think most would agree that it will depend on the priority of our projects and our tolerance for the possibility of failure to operate at a given moment.

Joe Shawfield