Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was thinking about a live editing environment where code / a source file is synchronized so that changes made by one user would be carried across to all others editing the file. Something like Google Wave, but for code.

Could this kind of an environment be better for the code, as changes are shared instantly? (with revision-control, of course)

Has anyone tried (or has had a need for) using a shared environment for code? I'd love to hear from someone who has used such an editor.

share|improve this question
9  
Would you like to work in an environment when every one of your teammates can mess with your work right under your fingers at any time? –  tdammers Nov 19 '11 at 17:02
2  
@tdammers Wouldn't it be something like this question? You could mess it up, but it doesn't mean you would. IMHO, teams are built on trust. –  Sathvik Nov 19 '11 at 17:09
    
This is not a question of trust. Developers have invented version control preciselly to get out of the changes of coworkers. The problem is not with trust or with changes. It is with the timing of taking these changes into account. –  mouviciel Nov 21 '11 at 8:38
    
@mouviciel , What could be wrong with taking them continuously? (As long they don't bother you, like in GDocs/Wave?) –  Sathvik Nov 27 '11 at 2:48
1  
Everything lies in "as long as they don't bother you". From my experience, even with version control, other's changes eventually bother you. Murphy's law makes sure that it's the day before a major release. –  mouviciel Nov 27 '11 at 8:56
add comment

4 Answers 4

up vote 5 down vote accepted

You are talking about a collaborative real-time editor, which is an old idea. There are numerous products that support it to varying degrees. Check out SubEthaEdit for a recent example. This screenshot provides an overview of how it could be used in practice.

share|improve this answer
add comment

I can think of just one use-case where such behaviour would be a benefit: Pair programming in a geographically separated team. And then the file should be lockable and one should be able to grant editing permission only to the people you want to work with in this session. But this scenario can already be handled better, with other tools like TeamViewer for example.

For most other use cases this scenario is horrible. There'd be plenty of collisions between people who are editing the code simultaneously. Have you ever experienced probems while merging code into source control? And now you want to have these problems while working live on a file? In real time? Your code gets messed up and you cannot compile it because someone else just hit the save button? Or even worse, your changes get lost! Congrats, you just lost two hours of work just because someone decided to save his version.

share|improve this answer
    
Thank you for an insightful answer. Could you elaborate on the problems you've had with merging code? Also I don't see why changes would be lost with a revision control, like Google Docs has. –  Sathvik Nov 19 '11 at 20:08
    
@Sathvik: Have you ever merged code? Try it and you'll see. Also, if every minor change is persisted in revision control, then these troubles will become even worse. How can you find a working version? It'll lead to problems in your CI environment. –  Falcon Nov 19 '11 at 23:10
    
Won't the live editor automate merging, thus taking away that pain? –  Sathvik Nov 26 '11 at 8:02
    
@Sathvik: In many cases, automerging is not possible! You have never worked seriously on a team with source control, have you? –  Falcon Nov 26 '11 at 10:02
    
Could you please explain? GDocs seems to be doing it right.... –  Sathvik Nov 26 '11 at 14:02
add comment

I've used a VCS in which you saw immediately the check in of others if you hadn't modified the files. It was a mixed blessing. It was beneficial enough that I seem to synchronize my workspace far more often that those who haven't used such system but problematic enough that I appreciate the possibility to delay the synchronization at a time convenient for me.

Real time merging the file I'm currently modifying with what my colleagues are doing now on the same file would be nightmarish. How could you work without being sure that the strange behavior comes from my changes (that's already sometimes difficult to admit and to find) instead of their? What about them introducing a dependency on a modification on a file I'm not modifying?

share|improve this answer
    
What kind of problems did you run into with that VCS? Also, won't a Server-Managed blame system with a shared repo eliminate worries like new dependencies? –  Sathvik Nov 27 '11 at 2:51
1  
@Sathvik, try to change the content of a source file while you have a debugging session on. –  AProgrammer Nov 27 '11 at 8:32
add comment

It's a good idea, but the only time that it would be useful is for remote pair programming, as mentioned by Falcon.

Version contol systems and automated testing eliminates the need to see what changes other people make. A shared repository makes sure that all the code fits together and unit/functional testing helps prevent introducing errors. Therefore one person doesn't need to see the code that someone else wrote.

share|improve this answer
    
I've never used VCS on a live project, so could you please explain how VCS obsoletes live/shared editing? Also, isn't merging, a pain with current VCS? –  Sathvik Nov 27 '11 at 2:54
1  
VCS doesn't mkae live/shared editing obsolete. VCS and tests make it unnecessary. VCS makes it possible for everyone to work on the same code base. Tests make sure that when one person changes something, nothing else gets broken. Therefore, you don't need to know what changes other people make. –  B Seven Nov 28 '11 at 2:46
    
I think new VCS like git make merging easy. –  B Seven Nov 28 '11 at 2:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.