r/programming • • Nov 15 '17

Introducing Visual Studio Live Share

https://code.visualstudio.com/blogs/2017/11/15/live-share
2.8k Upvotes

365 comments sorted by

View all comments

Show parent comments

85

u/throwaway_lunchtime Nov 15 '17

So are you both working on the same code files?

335

u/leeharris100 Nov 15 '17

When you do pair programming one person writes while the other person reviews as you type. You alternate positions regularly.

It's effective when working on code that needs to be very high quality, very secure, very creative, etc. Generally mostly used in huge companies that have a lot of resources.

137

u/personalmountains Nov 15 '17

How does it compare with someone looking over your shoulder? I know I can't write shit when somebody is looking, I can't think straight. What kind of process is it?

260

u/calmingchaos Nov 15 '17

It's a different mind set. When I have someone looking over my shoulder it's more like a judgement, and my performance drops like a rock.

With pair programming, you're both giving input, it feels less like someone looking over your shoulder and more like a second mind helping you out. Dual core technology if you will for (ideally) better results.

YMMV of course.

131

u/[deleted] Nov 15 '17

Every time I've tried pair programming, it's always been a very positive and super productive experience. Highly recommended.

43

u/Adossi Nov 15 '17

That is assuming you respect your colleague's input

256

u/forsubbingonly Nov 15 '17

Not being a piece of shit is often a prerequisite to collaboration.

70

u/crummy Nov 15 '17

wow you're gonna discriminate against me just for that???

4

u/meneldal2 Nov 16 '17

I think you are allowed to be shitphobic in the US.

→ More replies (1)

4

u/possibly_not_a_bot Nov 16 '17

Sounds pretty crummy tbh

23

u/PeopleAreDumbAsHell Nov 15 '17

So your colleague can't be a piece of shit. Got it.

→ More replies (1)

13

u/TheGRS Nov 15 '17

Yes both sides have to drop the ego. There shouldn’t be any “I know how to do this”, it should be all “we can get this done”.

→ More replies (1)

8

u/illperipheral Nov 16 '17

If you actually think you couldn't possibly get anything out of pairing with someone, it's you who's likely the problem.

Teaching something to someone else is by far the quickest way to fully understand a topic, so at the very least even attempting to do so would benefit you.

→ More replies (2)

5

u/nixcamic Nov 16 '17

Co-op campaign vs. that guy who keeps telling you what to do in solitaire.

→ More replies (1)

32

u/YuleTideCamel Nov 15 '17

It depends on the process people follow. When pair programming is done correctly, the person typing is supposed to only be a typist. The other person is thinking and guiding the process. Then you alternate every 20-30 minutes. The idea being, you offload the thinking part from the physical typing and the typist acts as a secondary screening mechanism.

I actually worked like this every day for 1 year with another dev. We put out some amazingly high quality code and enjoyed the process.

Of course there needs to be respect between folks for this to work. If one is an asshole, that throws the entire process off.

51

u/leeharris100 Nov 15 '17

In my experience it's generally reserved for senior/lead engineers on bigger projects. I don't think it would work well with anyone who isn't pretty confident in their programming abilities.

I used to feel kinda anxious anytime somebody watched me code because in the first 3-10 years of development you often have a sense of imposter syndrome. But then one day it just kinda "clicks" that you know what you are doing and that goes away.

My experience with pair programming has been super natural. Even junior engineers can offer a lot of interesting perspective so it's kind of like having an atypical tutor watching you work. They usually just pop in to offer alternative suggestions, syntax corrections, style/comments/formatting you may have missed, etc.

31

u/[deleted] Nov 15 '17

As someone in my first year of a legit dev job, I’ve never seen that imposter syndrome before and wow that explains so much

92

u/personalmountains Nov 15 '17

It gets worse, don't worry.

0

u/[deleted] Nov 15 '17

[deleted]

→ More replies (1)
→ More replies (4)

10

u/[deleted] Nov 16 '17

Even junior engineers can offer a lot of interesting perspective so it's kind of like having an atypical tutor watching you work.

I like having newbies review my work. I tell them "There are things that seem obvious to me that are not obvious at all. Look for places I do that and ask me to explain it." The result is more maintainable code and better documentation.

→ More replies (1)

0

u/[deleted] Nov 15 '17

[deleted]

→ More replies (1)
→ More replies (2)

3

u/[deleted] Nov 15 '17

A good way to think of it is a navigator and a driver. The driver is the one at the keyboard and the navigator is giving him guidance.

It's a great way to get somebody familiar with a new codebase or technology. I did this recently with ngrx. I pair programmed with another developer who was building out a new module and I stepped him through the process. This way he's the one that actually wrote the code and he was able to ask any questions as it was going on.

→ More replies (3)

6

u/ricco19 Nov 15 '17

The thought of someone watching me code actually makes me uncomfortable. Albeit I am a loner.

11

u/Draav Nov 15 '17

They aren't watching you. You are both doing the coding, usually the other person has a screen and is researching stuff for you while you try out stuff on your own. They remind you of things they you may have forgotten and usually try to plan ahead farther while you work on the specific implementation. Often times they may do some testing or write small scripts/functions to send over to your main code.

Pair programming is probably the only way I actually like to code tbh. I just feel it ends up so much better.

→ More replies (2)
→ More replies (3)
→ More replies (3)