views:

358

answers:

7

Hi,

I'm working on some PHP code with a partner, and were both running a LAMP (or in my case - MAMP) server locally on our machines. Is there some way we can both work simultaneously on the same piece of code? This would require both our IDE's (I use Zend Studio, he uses PHPed) and our MySQL server to update when any change is done.

P.S. - Is there any system that also allows real-time commenting on code?

Thanks.

+2  A: 

Since you already use SVN then working on the same code is possible and it's a matter of committing, updating and resolving possible conflicts while merging. A little bit of communication on what parts of the application each one will work on definitely helps.

Regarding changes on the db here is how it works for me. Every developer works on his local machine with a local instance of the database where he can experiment and do whatever he wants. When changes are permanent he commits an SQL delta script which goes into the repository together with the code.

cherouvim
+4  A: 

Not simultaneously AFAIK, but you usually don't want that either. (Sit by the same computer if you really need that.)

The accepted workflow for collaborative coding is to make a set of changes, be satisfied that they work, record them, integrate some changes from your buddy, make sure it works with your latest changes, then start again to work on some new changes.

You should check out some DVCS-system, like Mercurial or Git, that allows you to share recorded changes (aka commits) back-and-forth.

Marcus Lindblom
Bazaar is another good alternative to Mercurial or Git.
thomasrutter
Right. There are a few of them.
Marcus Lindblom
+2  A: 

You can use any emacs, and open display on other machine ( M-x open-display ) Or you can use screen or you can use VNC


Just saw this for Eclipse: http://wiki.eclipse.org/DocShare_Plugin

Vardhan Varma
A: 

I am in this situation with someone else. We mostly work on separate files and then check our changes into subversion when we have something that doesn't break the site. We do frequent check-ins and update our code whenever the other checks something in.

The other helpful thing we did was to have a link on our test server (separate from our MAMP installations on our local computers.) which will automatically check out the latest version of the php code from the repository and re-load the page. Basically make it as easy as possible to get code updates.

alxp
+1  A: 

If you want the database synchronized you need to use the same server. Eclipse has a plugin called Cola that allows real-time collaborative editing, but I don't think that it's possible with 2 different IDEs.

tstenner
+1  A: 

Since you use MAMP I suppose you are on a Mac. SubEthaEdit is for real-time-collaboration. http://www.codingmonkeys.de/subethaedit/

If you want to hold on to your different IDEs and need real-time-changes I think you have to write a script on your own.

Jakob Stoeck
+2  A: 

If you want to work concurrently on the same code base, but different parts of code, SVN is the best option. But if you really need simultaneous work on same code, you need collaborative editor like eg. Mozilla Bespin.

In most real life situations first option, together with some IM is more then enough.

vartec