4 ms·
Unintentional copyright violations and “leaking” of secrets people accidentally committed to public repos aside, my main issue with Copilot is that I don’t thin
by MontyCarloHall 5y ago
Unintentional copyright violations and “leaking” of secrets people accidentally committed to public repos aside, my main issue with Copilot is that I don’t think it actually makes coding easier.
Everyone knows it’s usually far easier to write code than to read code. Writing code is a nonlinear process: you don’t start from the first character and write everything out in one single pass. Instead, the logic of the code evolves nonlinearly—add a bit here, remove a bit there, restructure a bit over there. Good code is written such that it can be mostly understood in a single pass, but this is not always possible. For example, understanding function calls requires jumping around the code to where the function is defined (and often deeper down the stack). Understanding a conditional with multiple branches requires first reading all the conditional predicates before reading the code blocks they lead to.
Reading, on the other hand, is naturally a linear process. Understanding code requires reconstructing the nonlinear flow though it, and the nonlinear thought process used to write it in the first place. This is why constant communication between partners during pair programming is essential—if too much unexplained code gets dumped on a partner, figuring out how it works takes longer than just writing it themself.
Copilot is like pair programming with a completely incommunicative partner who can’t walk you through the code they just wrote. You therefore still have to review most of it manually, which takes much longer than writing it yourself in the first place.
- whydid 5y agoIn theory, I agree with your point. However, I've worked with people who struggle to write in English without introducing random punctuation, and don't "see" (or care about) the text on the screen enough to go back and fix it. I think Copilot will be a great benefit to the lazy programmer, who understands the semantics, but just can't be bothered to get the indentation or other syntax correct.
- MontyCarloHall 5y agoI 100% agree, but that’s exactly what code linters do, which have been around for decades. That said, a more sophisticated linter might be useful in catching non-idiomatic, but syntactically/stylistically valid code that would thus be flagged as “valid” by current linters’ simple automata.
- schwartzworld 5y agoNot sure what language you work in, but in JS we have tooling like prettier so we don't have worry about code formatting so much.
- masterphilo 5y agoCopilot, as far as I know, also does not seem to factor in the greater context of the application/code you're in when auto-completing these tasks. To me, this is a huge part of modern-day development. It's not only about producing functionally correct code, but also code that integrates well and is semantically relevant to the broader context of the application itself. That doesn't mean Copilot's input will have no value, but it just means that developers will generally need to refactor that code in a way consistent with the app they're building.
- Olreich 5y agoI think if your code requires reconstruction of nonlinear pieces to read it, you’ve written bad code. Fundamentally, a program is a list of instructions for a computer to run. The more linear that list is, the more efficiently the computer can run it. Linear code is also much simpler to read and understand for us humans as you pointed out. Iterate on the code until you find the linear path through it, otherwise you’re going to be in a world of pain if you need to understand it in the future.
- MontyCarloHall 5y agoIn principle I agree, but it often can’t be avoided. Function calls, loops, and even things as trivial as Boolean short circuiting are all examples of essential, unavoidable nonlinear code.
- rorykoehler 5y agoMy main concern is it will give non-technical managers funny ideas about what goes into writing code. Writing out what you want to do is the easy part. Figuring out how to do what you want to do in context of the broader environment is the main challenge and that requires time to think and reason.