4 ms·
I've also been in industry for ~17 years and coding for a decade or so before that, but I'd seriously sit down and watch an hour long video of someone just usin
by physicles 3y ago
I've also been in industry for ~17 years and coding for a decade or so before that, but I'd seriously sit down and watch an hour long video of someone just using AI to work on a large existing system. Virtually all the AI coding content out there is about building something new from scratch.
Could elaborate more on your workflow? Do you use Copilot, or just GPT4? Are you copying and pasting large blocks of existing code to hint at how things should fit together, or do you describe how the existing code is structured in English? Do you find yourself decomposing your work differently so as to fit your new AI workflow?
- t1mmen 3y agoI use both Copilot and chat with GPT4. For now, it’s mostly copy/pasting large blocks of pre-existing code, types, etc. I have a pre-defined prompt set up to explain how to behave, languages I know, libraries in use, naming conventions, how to respond, etc. I talk GPT as if it’s a skilled colleague who’s got memory issues. When it forgets, I remind it with stuff like “this is our current code now, remember X, Y, Z” I’ve become an even bigger fan of small, compostable functions that do one thing very well. GTP excels at that, both writing and testing them. I don’t involve it much for architecture and high-level design atm (mostly because I got that part solved on my current project). I tend to have a design in mind, give GPT the overview of how it fits together with mock code, and ask it to review with me, propose other paths we could take, etc before proceeding to implement. One function at the time, with tests. When refactoring happens, it’s usually isolated to a few hundred lines at most. When tests fail, directly or indirectly, I give it the full output and ask it to debug and fix. I find this helps GPT remember the code’s responsibilities when it gets lost/forgets. It also helps me avoid regressions when GPT returns functions that miss use cases we had covered before. I keep long running chat threads — weeks at times, hundreds or even thousands of messages. The longer we go, the better it tends to perform (web app performance, even on an M2 Studio, does suffer after a while though) At worst, GPT is a fantastic rubber duck. At best, it’ll help me see superior approaches and solutions I wouldn’t have considered, AND give me perfect code in seconds. Once tooling gets really good, and AI can understand the whole code base/database/infra… we’ll probably be in real trouble.
- physicles 3y agoThanks a ton! Details around this use case are conspicuously missing from the public discourse. You've really changed your workflow to adapt to these new tools. The amount of mental effort seems comparable to learning a new IDE, maybe a bit less. Instead of the chat app, I wrote a python script that uses the GPT-4 completion API. I can just pop over to the terminal and type 'chat' and it's there. As far as I can tell, it's basically the same as the app. We are starting to see AI tooling that can fit an entire 100k line code base in its context window. I still see myself having a job five years out. Ten years out, not so much. Luckily I'll be close to retirement.
- t1mmen 3y agoI suppose I have adapted quite a bit, but it’s just a different path to the same style of code/modularity I’ve found most effective/productive. I was primarily FE for a while, and used to agonize over the smallest details when building eg React components. After a few years, I concluded that the innards don’t really matter most of the time, at least not early on, so I limited my obsessions to the “public interface” (naming, types and prop design) and libraries of well abstracted, composable, low-level building blocks. If and when things needed to be rewritten or optimized, replace the internals. ChatGPT just gets me there faster, and more often than not, gives me acceptable production-level innards while I get to stay focused on perfecting the exterior and cohesiveness of the overall solution. I’ve found this approach usually pays dividend when reworking parts of the system, too — GPT picks up on the flow of everything much better when the code is “self documenting”. Same appears true if humans need to get directly involved. Still blows my mind on a daily that we’re here already. I’m glad I’m not early in my career, I’d be very worried if I had another 40 years to go.
- t1mmen 3y agoI've got all of 30 minutes of experience with https://www.cursor.sh https://www.cursor.sh, but this appears to be another major upgrade to my workflow. In-context editing by AI, without any of the copy/paste annoyances. The PR I'm currently working on has about 1K diffs – I've literally touched NONE of that code directly. Freakin' wild!