VS Copilot - Seeing is believing
-
One day I may expand this in an article or tip, but for the moment, just wanted to share my first experience with Copilot in Visual Studio.
Context: writing a MTTQ client in C++ almost from scratch.
One line summary: Wow!
After logging in, Copilot started producing ghosted text suggestions, sometimes one line at a time, sometimes full blocks. For the most part it was very accurate and didn't go ahead of itself hallucinating code. It clearly knew a bit about the protocol itself suggesting for instance that a
publish
method should have aflags
parameter. On the other hand, when validating a received PUBLISH packet, it fumbled the flags validation code.At times it was scaringly accurate: I had my packet sending code spread in various parts of the code with associated critical section locks and error checking. This morning I Visual Studio with the intention of grouping said code in one method. I just pressed "enter" in the header file and Copilot suggested
erc send_packet (Packet& pkt);
. I felt like it was reading my mind.In general reminds me of a time when I was doing pair programming with a junior programmer: I had to look over his shoulder and take control from time to time, but it saves so much time on repetitive code sections that is definitely worth it.