The Hidden Cognitive Cost of AI-Assisted Programming - Ragunath Jawahar
About this talk
This talk explores the speaker's journey in working with legacy code and the integration of AI tools in software development. He defines legacy code as any code that one is unfamiliar with, highlighting the subjective nature of this concept. Beginning his journey in a fintech startup in 2017, he struggled with a lack of tests in a well-written codebase, prompting him to study Michael Feathers' principles on legacy code. The speaker emphasizes his experiences in applying forensic techniques to codebases, particularly through mining Git histories to identify critical components that require attention. He shares insights on using AI and various tools to facilitate code comprehension and refactoring, ultimately grappling with the psychological impact of AI on developers, decision fatigue, and the quest for balance in productivity and mental well-being.
Full transcript
Before we get into the talk, I want to give you a little bit of um introduction about myself. Uh the I I I believe like the legacy code term is like super overloaded. Like it like it means different things for different uh person and like not everyone in the same room agrees agrees to the same definition. So, I'm going to like sort of like set a ground
where what legacy means uh code means to me, right? So, a couple of things. One is um code that you're not familiar with. Like regardless of whether good or bad is always subjective. Often times, familiar code is labeled as good code, right? So, for me, when I say legacy code, legacy code is code that you're not very familiar with, one. And the second thing is the code
that was not produced without too much of your involvement. Like that's what legacy code means, right? So, that's the kind of code bases that I uh deal with. And um I started working with legacy code uh in 2017 where I was working with a company in Delhi. It was a fintech startup. They uh I like what do you call it? Like they brought in code from a
third-party uh agency. Uh it was a mobile application. And I had a very uh a hard time working with the code base because there were no tests even though the code was well-written. And I had to like read uh Michael Feathers' book for the first time and that's when I sort of uh was drawn towards this field of like how do you work with code bases that
are hard to work, right? Like are are hard to understand. And later in 2019, um I started work with like an enterprise organization and we still had like a lot of legacy code problems. And this person called Adam Tornhill, um he is someone who is a software engineer, but also did his master's in criminology. So, he was trying to find out like how do I apply this
knowledge of finding a serial killer on a code base so that you can come up with ideas where you can figure out which are the right parts of so code base that you can work with, right? So, he applied all of those forensic techniques on code bases pri- primarily through mining a lot of Git history. And that was another unlock, so that eventually changed the course of
my entire career. And in 2023 is when I bought this domain called legacycode.com, and everything else is happening uh there ever since, right? Okay. And now we all know producing code is almost mechanized, right? It's like industrial revolution, and you're like producing code in superhuman levels, right? It's It's not even superhuman levels. It's like it it it is at machine speed. So, it's production of code is
already mechanized. So, if you're trying to understand or if you're trying to fix you still need a similar capability, right? Like so humans trying to review code, humans trying to understand code, humans trying to fix code, it becomes very very hard. And a lot of this thing that is related to comprehension, right? In 2019 is where I started working on building tools that will help you understand
parts of your code bases, mostly extracting specific parts or specific structures from your code base and using appropriate visualization to look at um how those parts of the code base look look like, right? And then eventually I started um uh when you start working with clients like spotting the problem alone is not sufficient. Like you also have to go and fix it, right? And And one of
the problems that commonly came across when I was working with most of these clients is you would have this one very long uh Java class, like 7,000, 10,000 lines long. And then often times like that is where like the analysis would point you to, okay like this is the top of the funnel, this is where most of the churn happens, development happens. This is where there are
a couple of people who get won't go on vacation because they're the only two people who can work on this code base. And if you say it's going to take three months to do this here, it's probably going to take six. Right? So that is like the common theme that came across most of the analysis and like and and part of that experiment is when I wrote
a tool that can visualize networks inside a large class. And once you can visualize these networks, you can extract them into smaller classes and you can start writing test for them, right? It's also pre-AI. Very algorithmic. And this year is where I focus more mostly on mechanized verification. So right now we verify software mostly by reviewing codes. Like you give the AI something, it generates a lot
of code and then whatever code it generates you end up verifying, right? Like you do manual reviews. There are different ways to do this. Some of them are experimental and I've had some success in both these areas where you verify and you also evolve software without supervision, mostly autonomously. And these are some of the areas that I focus on mostly with tooling and this most of those
toolings are also being augmented with AI, like agents in general. That's what it is. Now before we move forward, I want to know like get a feel for the folks that I'm speaking with. And I want to just give me a raise of hands, like how many of you started using AI or coding agents this year? 2026. One. Welcome to the club. Folks that started using it
in 2025. 2024. That's why you're all in the front row. What about 2023? No? 2022? Okay. Yes. Copilot was released in 2022, I guess. It was not an agent without a complete from Copilot. Yeah, it was not an agent. >> Pretty Claude was the first feature I could I'm genetic, too. >> I think it was Coder. Yeah, right? So, that's what I look like. Okay, so I
started using AI in early 2023, right? So, this talk is going to be my own journey about how I started using AI, how I unlearned a few things, how I learned new things, but and also how all the kind of impact AI has had on me, um like adverse effects as well as good ones. And at the end we'll talk about ways on how I'm trying to
recover from some of these effects that are undesirable. all right. This uh Okay, there's one more thing I wanted you to do. If you have a notebook, kindly note down the year uh or the month or like the the number of years ago and then like spends on um AI, right? Like that's something that I would like to keep you all up because I want you to
look into the different kind of impact AI has had on me and my workflow over the period of time. I'm going to like sort of re-reference this journey again and again. So, for you it would help to know, okay, like this is what he's talking about, right? So, this is April 2023, 3 years ago, um I spent about $10 a month on GitHub Copilot subscription, right? At
this point in time, um I I still remember there was some announcement GitHub made in 2022 about how they're going to automate software engineering, right? And when when as a software engineer, if you spent almost a decade building and then suddenly someone tells like we're going to automate your job away, like then that is an existential problem. Like it's it's still an existential problem for a lot
of engineers even right now, like those who are sitting in this room, but even people outside this room. And the first thing I did was I used to work with this uh developer in Canada, like he's a friend of mine. He did his masters in AI and ML. So, I sent him a text on WhatsApp and I said like dude, like we should we should speak. And
he got on a call and then uh we had this long conversation about like how AI is going to replace uh us and all of that. And he said like dude, this is the same story they've been telling us for the past 30 years. It's not going to happen, right? Even though it is relieving because he's an authority because he's the one who studied AI ML at
college, like I have no AI ML background. And I was like, okay, he's the expert, but like that's your logical brain thinking. But then there's your reptilian brain, your limbic system telling you otherwise, right? Like it's it's like dude, like what if he's wrong, And then what I do is I go, get a GitHub sub- subscription, and then start trying trying out this tool, right? the first
thing on my mind is I want to prove to myself that AI is not good enough. Like it's not going to replace me. I'm still valuable. And I want to see what it can't do, right? Like at this point you're like you're not trying to see how AI can help me because if it is going to help me, then it's probably So, I was like, okay, like
this is going to sort of I am going to prove to myself and the world that AI cannot do what it claims to, right? Like that was my first mindset. And the way how I was trying to evaluate Copilot, it was just auto completion. So, I installed the corresponding the plugin. in a Java developer. I started writing um um code, right? And and oftentimes when developers are
exposed to a new technology, uh something like AI, the first thing that you try to do is you try to do the things that you're already doing, but then a little bit faster, you are a Java engineer, someone teaches you Kotlin, so you learn you write Java in Kotlin, right? You don't really use it idiomatically or like you don't make the best use of the tool that
is available to you. You try to say, "Okay, like if this is what it can do, can it do it a little bit more faster?" And for me, I come from a TDD background, so I used to do TDD, like very extensive TDD. Um I did I did like three workshops with Venkat. Venkat was the one who actually coached me with uh test-driven development. So for me,
what would happen is I would uh write a test, make make sure it fails, and then write the minimum amount of code to make it pass, right? So that discipline was ingrained in my personality. So TDD was um I I would say like I would practicing TDD to the to the letter, like what I was taught. So the first thing I did was I started writing tests
with AI, right? So you uh open a file and you look It looks at the name of the file, and start writing tests, and then what the AI does if the AI can generate tests in sequence. So instead of writing one test, it it start starts to write five, six, seven tests. And at this point, it's also surprising because it can replicate the pattern, right? Like you
write the first test, and then it writes the rest of the And I would not let the AI to write the production code because like you know, like the AI will again write a huge function and make it pass, which is not what I wanted. So at this point, I'm trying to prove that AI is wrong, and I'm using it to make sure that I can do
whatever I'm doing already, but in a little bit faster way. This work, right? But then when I do production code, it would get annoying, so I would turn off auto complete inside the IDE, then I'll write my code myself, right? So, there was a little bit of friction between the two, and it was also not generating like very good production code. Like it was able to replicate
existing structures. It's probably like a one shot or a multi-shot uh in the context window. So, if it had one or two examples, it would do a better job, but then often times it was not very very helpful helpful at all. So, that was the first exposure to AI like for me. Like this was um April 2023. this is almost a year and a half later, isn't
it? Yeah. This is October 2024. And uh this was the first time like I I was using Copilot for a very long time and and Copilot I was also using it because it was helping me to build new code or build new modules, but then when you're starting to use it on existing code or like code that was already written, like the auto complete was not really
great. Like the Copilot auto complete was like struggling like giving you like it was more annoying than helpful, right? And and I I still remember there was this talk in one of the Microsoft conferences. Some folks from the Copilot team, they said, "Hey, this is a reality check for you. This is what Copilot can do today. This is what it can't do today." So, they were like
not trying to sell Copilot. They were trying to sell the reality of Copilot at that point in time. So, that was also probably PR to do a little bit of damage control over whatever capabilities that they had back then. And then October 2024 is when I don't know what kind of models we had some um stuff, but then um it was a long time, right? Like it's
a year and a half ever since I tried AI for the first time. I was using it a little bit, but I was not very invested in it. And at this point in time is when I realized uh ChatGPT as well as Anthropic Lord were like really good at that point But then for me, the more I thought about TDD, TDD is not actually about tests, right?
Like TDD is never was never about tests. TDD was always about behavior and design. Right? It was all about design because if you can write a test for a client before the client exists, which means your design is good. Like the the proxy for a good a test that you can write before writing the production code is that you have thought through the design, right? And since
I've been doing TDD for a while, I sort of have like some sense of what a good design look like. Like I still have to look at the design to say whether it's good or not, but when you designing systems from the ground up, it's a relatively easy to say what a good design looks like, right? Like is it can it be pure? Like does it have
inputs and outputs? Are side effects pushed to the edges? For example, are you not using like are you just using pure functions or are you using callbacks to model boundaries? Like a bunch of stuff, right? And at that point in time is where I realized, "Okay, if I can say if this class is meant to do this thing, I can let the AI generate both the test
and production code. And I can just like review the API surface and I can also review the tests to ensure that the AI has done a decent job, right?" So, this is the point where I let go of control a little bit and instead of thinking in terms of functions, I started thinking in terms of behaviors and also like a bigger piece of the system that I'm
trying to build. So, at this point I was like spending about $20. And I did not know Cursor exist. I did not know Cursor existed. So, I had this huge huge code base. I would like pick and choose the context. The context was manually curated by me. I would say, "Okay, like these are all the things that you need. This is what I want to do. Can
you do this for me?" And then the AI would do like chat GPT would stream its response or like Claude would give it me its response. And I copied stuff from my um browser and then I paste it into my IDE. Uh it was I I I didn't mind actually at that point because I knew it was doing more work than I could actually do it on
do on my own. So this part is where I also restarted like rethinking my own practices and workflows. So November is where I go to um a cafe and meet a friend of mine and he's like um ex-co-jack uh ex-head of engineering and he has he he has me uh all these wild stories from me like hey like you know what I'm building a electron application like
this is what it's doing and I've done this in like 10 days or whatever and he listens to me to the end of the conversation and he's like dude like why can't you use cursor? I was like what is cursor? And he was like he said like whatever you're doing right now you can do it without copy-pasting stuff because it edits file in line. It gives you
diffs that you can review right there. Why don't you use I was skeptical because I was already used to the workflow. I was like pretty fluent with like copy-pasting stuff like of course developers are good at that. and then one point in time I was like okay I'll give this a try, right? So maybe after like a couple of days I was sitting on it a couple
of days after I tried cursor I really liked it and cursor also did not have multi-file edits at this point, right? And and and little later is where they introduced something called as a composer where you can edit multiple files. So that came about like maybe in December or January I don't remember. And at this point I was spending money on both a chat product because chat
and agentic IDEs were very different concepts back then. So $20 subscription on Claude, ChatGPT, whatever and then $20 on uh cursor, right? So this is what um uh I was doing. At this point I also started measuring productivity because like developers like measure productivity how? Like you know how number of lines of code, number of commits that you make. Like, that's how we measure productivity, which is
not the right way to measure it, but it makes you feel good. So, what, right? So, I would like spend uh a few hours, like 4 to 5 hours, and I would like end up checking in like 1,000 to 3,000 lines of code. That That includes like when I say code, it's always including tests, right? And often times it I had more tests than the production code
I was building. This is the most recent one. Uh it's going to get wild from here. January 6th, tried Claude Code for the first time. Like, a lot of people were raving about Claude Code, but then I also read about a few things, right? Like, the performance of your agents depends on the kind of feedback loops that are available to them. So, if you have an agent
running inside your IDE, it has tooling to all the instrumentation within the IDE, which means you have linters, you have uh compilers, and all of those incremental compilation errors that get fed instantly into your coding agent, right? And this is theoretical knowledge. And theory, I said, "Okay, like then, ID agents must be much better. So, why even bother with, what do you call it, command line? Yeah,
terminal agents. And I think like later on Claude also added support for LSP servers, but like at this point like it doesn't really matter. Like, it has been quite capable. Uh so, it doesn't really matter where your agents are running, whether uh IDE or your um whatever, right? And January is also a month where if you actively are on social media, like people make a lot of
claims, right? One One of the claims that people say is, "Okay, 70% of our code is written by AI And in the next 1 year, all the entry-level software engineering jobs will disappear. In the next 5 years, we will not need any software engineers." and Salesforce is like we don't need any software engineers we're not going to hire any, right? And then they go and hire a
lot of people again. So, this keeps happening and and the social media itself is like a source of stress, right? Like every time you look at it and like you know, people are like saying, "Oh, I'm running 20,000 agents at the same time." And and you're like, "What am I doing with my life?" Right? So, a lot of existential questions, especially if you're using social media. And
at that point, uh there were like a very very few things, right? Like all these frontier labs started making like a lot of different claims, like okay, like oh, this is what we can do. and there are also like a lot of people that started saying, "Languages don't really matter. Frameworks don't really matter. Like you can actually work on different ideas and uh you can ship things
in languages that you did not really know." At this point, I wanted to see this for myself, right? Like and and and and I think like there's also this one stunt by Anthropic where they were building a C compiler, spending $20,000 on tokens for over 2 weeks, and then people walked away. And a lot of people were like, "Okay, like that's stupid." And like a lot a
lot of noise and like a lot of opinions, but then what was interesting to me is what would it take for you to create a spec that will allow you to walk away from the computer? Right? Like that's a question that's very interesting. I find it very interesting, right? Because the compiler, of course, it's all like ANSI standardized and you always have a reference implementation. You can
just like compare your implementation to the Um it's relatively easier to build a C compiler, at least in my uh theory right So, that month was like I want to see how much code can AI write on its own. Okay, like that is going to be one thing that I wanted to test by myself. A second thing I wanted to test is can I really work on
a language that I did not really know? Right? And at that point, I also realized it was like it was not like I thought about it and like I came up with this wild idea. I was in a circumstance where I had to like sort of solve for a situation where I have to understand AI-generated code but without reading at the actual code, right? So, at that
point I was building this tool that could generate dependency diagrams, but it normalizes them to file level. So, instead of doing type level dependency diagrams, it started doing file level dependency diagrams, right? So, that was the tool I was building we using Golang. for me, okay, like I was not able to walk away from the machine, like that was a problem that I couldn't solve back But,
I was still able to ship in a language that I did not know. And I was also able to write I I think like pretty much 95% or more of the tool that I built uh by AI, right? Again, most of the edits that I made was like mostly renames, uh tiny adjustments that I thought that the AI would take a lot of time, and most of
them were like around documentation, right? in a couple of months I was able to do this like it's like again like bad metric again, but then the metric is here to one, two, for me to even realize like do a reality check, like you know, how complex is this software, right? Like it passes like 15 different languages and does a bunch of other stuff like draws diagrams.
And it's also a programming language that I did not know, And the it was not a stack that I picked, it was the stack that the AI picked for me. it picked up Golang because it had tree-sitter with bindings for more than 20 languages. But, for every other language that I was looking at, for example, Rust comes up with a tree-sitter binding, but then for every language
you have to generate the parser and then include the source code in inside the code, right? Like it's not like a drop-in that you can use. And at that point uh it was just too much because I was working on a different language and uh not very a lot of familiarity. So, at this point um to me it was a great confidence builder was a Java Kotlin
developer, now I can work on a different language. And also like uh the the complexity of the software was like genuinely uh mind-blowing to me, right? And it's also open sourced. Now, what happens here? What What's the most interesting part Sorry? Spend is $200. And it it went up $200 because like people were putting putting me on time limits. It's like, "Oh, dude, like you had a
You've had enough of your share. You need to come down for the next 3 hours, right?" And then I was building things in a way that became a bottleneck. Like, you know, the cost and the tokenization became a bottleneck. So, I ended up spending $200 across both Claude code and Codex up, like both combined. So, until a point it it's like this exposure thing, right? When you're
learning something new, you don't really get to use it in the most optimal way, right? You keep experimenting with it. You get You try different things. And then you also listen to what other people are talking about, what other people are saying. And then suddenly it clicks, right? And when it clicks, it really clicks. So, after like almost 3 years of expe- exposure is when um I
started doing all of these stack. But these stack, Rust and TypeScript especially, I did not pick them by myself, right? Those were choices made by the large language model because I was specifying, "Okay, this is the domain. This is the problem that we're trying to solve. What do you think is the best stack to solve this problem?" And often times like when I when I work with
legacy code, I work a lot a lot with language parsing, visualization, that kind of stuff. So, Rust turns out to be the best choice according to the large language model, right? And I did not even push it a lot because for me, if I'm a legacy code engineer, right? And if I can work on different codebases, like polyglot codebases, then I shouldn't have a problem with this.
As long as it serves my audience and as long as it serves my problem domain, right? So So even though like in February I was just comfortable working with one programming language then it become um wild February, right? And at this point I also genuinely believe and this is is my belief from February 2026. Even if the frontier labs stopped working on these right in February, right?
We have enough capabilities to build like, you know, for almost all problem domains, right? Like right? We we're already there. Like you don't need better models to do better work with AI. You probably need better tools to work with like old and large code bases, but the frontier side, even if there's not not enough improvement, we have enough capability to work on software engineering problems. Uh That's
my opinion though. What happens here? It goes up goes up by another $100. That's on extra credits. So that's why you don't have like a nice round number Um here is where I also was able to create a platform that also does like self-verification. Um as experimental as like worked really well on a couple of applications. But what it let me do is uh run like long
horizon tasks, right? So this is one of the stage where uh when I was asking like what are the kind of specs that you need to write that you can walk away from the machine. And this is where like some degree of success in that aspect. So 6 hours of unattended workflows. So my agents keep running. So I have like 6 hours on my hand. But the
result is burnout. I think the story sounds like very compelling, interesting. The token spends have gone high. But it's it's just like I'm I'm actually recovering from a burnout right now, Now what we're going to do is like there are these are these These are I think like the significant moments in how I adopted AI. And now what we're going to do is like how the kind
of impact it has has and it has had on my own cognition, right? Like my own mental health as well as my mental capabilities over the period of time. So that also like some of these things you probably will be able to relate to like a lot. So what I'm going to do is I'm going to talk about a few of these mechanisms like the the way
how human brains works, how uh human cognition works and when you're shifting your workflow, when you're making something cheap, something becomes expensive or like something gets moved around. Like the cost just move around, right? They they Just because something gets optimized in one place doesn't mean like you get gains along the entire pipeline. Those costs like they keep just shifting, right? And when the costs get offloaded
to you as an engineer or your fellow developers as an engineer, you cannot ignore it, right? Like that you can only sort of find a balance that is still possible for you to use AI in your everyday software work burning out, right? Like and with having a and and also do use the sustainably because it's a job that we do day in and day out almost throughout
the year, right? The first thing that we're going to talk about is the reward chemistry. Okay, let's talk about dopamine. Dopamine, um if you if you pay attention to uh there's something called as dose. Like heard of this term called dose. Like they there are like four different uh chemi- chemicals that people talk about. The The first one is dopamine. The other one is oxytocin. And then
you have your serotonin. And then you have your endorphins, right? And then say like you know, make sure that you get your daily dose of all of these four things so that you can have a live live a happy life and whatnot. Dopamine is actually not the pleasure chemical. Right? Like often times we think like dopamine is what makes you happy, but dopamine is not what makes
you happy. Dop- Dopamine is uh it's an anticipation chemical, which when you're anticipating something, that's when you have like the highest influx of dopamine in your system. Right? And what happens afterwards will decide how you feel. Right? Like say for example, you give your AI agent a prompt and it does like a really good job that you did not really anticipate, then you're going to have like
a positive prediction error because it exceeded your expectations. You would put You're going to feel like really really good about it and probably go talk to your colleagues about it. Like maybe give a talk to people in a conference. Or >> [laughter] >> or go ahead and tweet about it. And what happens is dopamine does not re- respond well to like uh negative outcomes. Right? So, you
give it a prompt. It just like go move this image by three pixels. And then it just like and changes the entire orientation. Now, you're really really really pissed off. Right? Because you're you're still waiting for something to happen and you're hoping that it's going to be good, but it's completely opposite of what happened. Right? So, there is a there is a crash, there is frustration, uh
there's whatnot. Right? And the reason why working with large language models is so addictive, I I for lack of a better word, is because like you cannot predict the how or when how often this happens. Right? Like because if it's going to do the same thing that you're going to do, there's just like one other normal day. Right? It doesn't like help you go back to the
same thing over and over again. But with large language models, it maybe exceeds your expectation, maybe meets your expectation, maybe sometimes it's like okay like I've taken you 90% you have to do the rest, and sometimes it's like completely does something unexpected, right? So that you don't really know when the reward is coming to you. And that's one of the reasons why you keep sort of like
going back and and the effort is also so low. It's just like one single prompt for you to give the agent like you're like you're not trying to work hard to uh get things done, right? If you're working with a colleague probably it's not so fresh pleasurable because you have to do meetings, you have to do orientation, you have to come to an agreement. There is probably
a schema that is shared between the two. So it's like not very very pleasurable, right? Like unless you get back to your job. And often times we even don't plan it because the planning itself is so painful. So often times you're like okay, let's just go and write the code, it's the same thing when when you the way how dopamine is released, um slot machine I don't
think like we not a lot of us would be able to relate to slot machines, but social media and agentic coding is also very very similar. It's just like the form factor is different. The the way how the UI looks different, but the kind of feeling that you get when you're using AI agents, especially if you're using it effectively, is almost very similar to like browsing social
media, right? Like a lot of novelty, uh lot of uh anticipation, right? for this to be more effective you need a loop, a loop that is constantly running, And sometimes that's that the the loop is more relatable when you're binge watching on a TV series, right? Because like you're working watching a TV series and often times a TV series always ends in a cliffhanger, right? And then
now you want to see okay like I want to know what is going to happen, so I want to watch the next uh series uh episode, and then you keep watching the episode until the series is over or it's like 1 or 2 a.m. in the uh night. And for a loop to have like this is how the loop is designed. The first thing is you get
for a prompt. You you send a prompt to your coding agent. Then you get you wait for a few seconds and then there is a outcome. I the outcome the the kind of prediction error could be brilliant, mediocre, or uh broken. So you really can't tell what kind of outcome you're going to get just by issuing a a prompt to your agent. And the dop- domain fires
on step two, right? It doesn't fire on step three. It actually happens on step two, right? And that's why it's also so painful to wait for the outcome to happen, right? You're still waiting and often it is slower when you're looking at it. 2 minutes is like a lot more faster when you're not looking at it. But if you're looking at it it feels like a lot
more slower, right? And like and it's also so painful that's because dopamine is like secreting when you're waiting for the outcome to come. It's It's like a release of your favorite movie, right? And it doesn't stop there. Because you also have heard of this term called hedonic treadmill, Um and I also think one is to lifestyle inflation is because like when you keep uh there's not a
money See, for example, it's not even a let's start with the good stuff first. Let's see how many of you think can be better software engineers? I'm going to uh All of us, right? How many of you think you were better software engineers 2 years ago? So so 2 years ago, like you could have been a good software engineer, but you're still aspiring to be a better
software engineer, right? And whatever kind of software engineer you aspired to be 2 years ago, you probably are that person now. But you can't see because now when I ask like can you be a better software engineer? Of course I can be a better software engineer, right? And that level keeps shifting over and over Right? Same thing happens to lifestyle changes, right? Like you make X amount
of money, then you make like a little bit more than X, then you make 2X, 3X. But if your lifestyle keeps going like then there's always something next to look forward to. Like the happiness level also keeps shifting. Like that's like the hedonic level, right? And also comes down to substance abuse. Like people say like when you take a certain when people are addicted to substances eventually
they keep increasing the intake of the substances because like to get the same level amount of pressure, you have to utilize it more. Right? So, you have the dopamine playing this role again because like the same amount of activity or the same kind of result is not going to give you the same amount of dopamine because like that's something that you're used to and the baseline has
shifted. And now we've looked at the dopamine mechanism. We also looked at how there is a dopamine loop that actually keeps you engaged with whatever you're trying to do. And then there is also like the hedonic treadmill. So, even if you keep doing whatever gave you pleasure yesterday or like for a week you're like probably going to like you won't feel motivated to do the same thing
over and over again because you have to do something else, right? And this is what happens. Right now you see how it the effect kicks in? You you can see here like the spend has also gone up, right? And it's not irrational, it's rational. Like it's rational. But then you also see like the all the mechanism clicked then I was not I was willing to like open
my I I wasn't willing to swipe my credit card. Like almost similar to gambling at this point. it just it often changes the behavior of like how people behave in terms of like you cannot fight these chemicals. Like you can still be aware of it. I would still do a cost-benefit analysis. Like, is it still worth spending X amount of money on something? But, for me, it
has been overall outcome. But, then, if you look at the number, like, it's a it's a it's a huge increase. Like, it's a 15x increase from what happened in January till March, right? So, this is something that could happen when you get uh hooked to the loop, I get I get you through the items once again. April, like, the Copilot days when I was starting to use
AI, like, it was not really great, right? Because, like, sometimes it was like incrementally better because it generated like a couple of test boards. So, that is not enough to, like, sort of keep you engaged for a very long time. it was like the the the loop was like not very uh reinforcing at all. So, there's not enough incentive for me to go and do it. Like,
I would like still program I would use Copilot, but then it was also more annoying than being helpful. So, it was not reinforcing the uh reward uh chemistry loop. Then, October it was slightly Again, like, October was when I got excited. I was telling my friend that hey, in I was using I built an Electron application. I was like copying a lot of code from the browser
to the IDE. But, then again, like, there's a little bit of friction when you're copying things from one place to another. Like, so, you really can't do much. Um and November Cursor, but then, like, I was also reviewing a lot of code. And one interesting thing that I noticed um is when you review a lot of code, you sort of like start feeling really really tired um
uh every day, right? Like, so, that's Have you folks experienced it personally? Yes, right? Like, the more the more you have PR volumes that are waiting for your review, the less pleasurable it gets. So, you probably are not getting hooked to PR reviews. But, then you're also getting tired and like you know exhausted within a short amount of time and sometimes I also believe this is an
adaptation. You probably are doing this consciously or unconsciously. You would probably be moving all of these things to the morning right like where you have the most amount of energy so you get out like get these done in the early in the day and then like move on later in the evening. So for me at this point in time I was also generating a lot of code
but I would also get physically tired. So anything that I would do would happen after three like you know like menial task that did not really require a lot of attention and I have to like really go hit the gym by the end of the day like otherwise I would feel like really drained and I would feel useless after five in the evening right so like for
me the the hitting the gym or like moving my body was a way for me to just like get back a little bit of energy from feeling completely drained right? It was a good reset. So January is when like you know we start locking in. So I was like looking at all of these things and I was saying what I can do but if you also look
at it the eight hours day like previously I was able to do only three hours a day but then eventually I was able to do eight hours a day. That's also because I was no longer reviewing the code line by line. Most of the time I was reviewing the dependency diagram to verify the system and I would use the tool to see if this diagrams were right.
So I was reviewing behavior. I was also reviewing structure but I was no longer reviewing code or test line by line right only when things get really hairy and it did not get hairy a lot. And look what happened here in February. So in January I tried to write a programming a code in a language that I don't understand and this month it only got worse. I
was like trying to push to write in like TypeScript Rust. Again like you know to get the same amount of feeling you need to like do increasingly challenging and difficult things Like that's your biology working. So, now writing in a language that I don't understand or a framework that I don't understand but has become a baseline. And for me to really feel good about myself, then I
have to like try and push myself to do something in a or tackle a slightly different problem, right? So, that's like the dopamine uh thing coming Again, March is that. Again, March is also when I was burnt out, so that's a different The second thing I want to talk about is the decision fatigue. So, every time when we make decisions, there's one thing that a lot of
people may come across. Like, you know, you know that Steve Jobs were was wearing t-shirt and like him wear the same outfit every single day, right? And Mark Zuckerberg also does the same. And earlier, like I never understood like why people used to do this, right? And like I'm not at a place where I it doesn't really matter. I can still pick my own clothes every single
day. Like, I I'm not at a point where I can I I have to make a decision on what to wear, right? Like, that's not really bothering me. But, when you see how you feel tired at like middle at the middle of the day if you're reviewing a lot of PRs, that means you've like sort of like made so many decisions unconsciously. Like, you you're waking up,
you're doing your daily stuff at at home, getting ready to the office, you're commuting. And if you're someone who's driving or riding, then you're making so many decisions when you're like going to the office. And sometimes you would also feel exhausted after reaching the office. So, you probably go have a tea or a coffee or have some refreshments even before you start, right? So, you don't really
feel how much of your reservoir you have already exhausted, right? You only feel the change in quality when you can visibly see it, but then the the depletion has happened like much earlier in the day, right? And that's why like sometimes like people that commute or take a vehicle to the office, if they stop driving or riding to the office and take a Uber or like, you
know, tag along with a friend or use public transport, they immediately feel a difference in the quality of decisions that they're making and also the amount of energy levels that they have after they reach office, right? And this is what happens like when you when you are making a lot of decisions like AI has made things a lot more easier but it has only created more work.
Like there is not enough people that are saying, "Okay, whatever I can do in 8 hours I can do in 2 hours. I would like relax for the next 6 hours." Like no, like that's not happening anywhere, right? Like you're still trying to find out what to do next and you're trying to still optimize for your capacity. But the capacity is capacity that you your brain does
not have, right? So you have like 6 hours of time left in the day. Of course like that's the time that you have available but do you have the capacity? Like that's a question mark, And so also like you know a a lot of stuff like you know surgeons do like complex operations in the morning if you have like business acquisition like you know large business decisions
to be made like acquisitions or mergers like they usually happen in the early in the morning and people also sleep like really well the night before, right? Because you want to have a clear head when you're making like really big decisions in your lives. So decision fatigue is one more thing that happens to all of us especially when you're using AI because you're constantly looking, verifying and
saying what correctness looks like. in this case I like when I started using Co-pilot like right? In fact like the number of decisions I was making was like slightly slower lesser because I was not like thinking about every single function that I was making because like agent was making most of those decisions for me, right? So at that point you probably see a little bit of dip.
Um and when I was reviewing a lot of code manually like both production test code that is when I was not able to do a lot of work for more than 3 to 4 hours every day like I would like feel the heat on it. But then, Yeah, so so that's when I have to go to the gym and recharge myself and get back to home. So
So my everyday execution really depends on how well I was taking care of myself. Like am I getting enough rest? Am I getting enough physical activity? Am I eating well? Right? Most of thought. And surprisingly in Jan, Feb, and March, I was able to like I had like a lot of all-nighters. Like I worked for even 16, 17 hours a day. A lot of that is like
not really sustainable. You really can't get away with sleep deprivation. It's going to catch up to you. You All of us like most of us should get like at least 6 to 8 hours of sleep every single the reason why I did not have decision fatigue during this phase was I had an alternative way to verify the behavior of the systems that I was creating. Like I
was not doing a lot of code reviews. That's one of the reasons why I was able to get away with it and I was also able to spend long hours building things. The other thing that comes into play is also multitasking and context switching. Also some of us are not really like humans in general are not wired to multitask. Like that's not what we are like made
for. It's a learned skill. Like we all learn multitasking just maybe because of the situation demands it. Or sometimes like that's how we have done things our entire life. Like that's not by choice. we also know context switching has a cost. Right? Like have you looked at this diagram where it says like you know, you have a you have a developer and then when you interrupt a
developer, how long does it take for them to get back to flow again? Right? And it's probably around like 20 minutes or 25 minutes. So, every time you say, "Hey, can we have like a short meeting or like I want to ask something?" That is like 25 minutes of like reorientation to the problem statement that you had, right? And earlier, you also end up spending a lot
of time writing code, but now that time period itself has gone down quite a bit because if you are deploying or like initiating multiple agents at the same time, then you're probably spinning off agents and like you're thinking about four or five different problems. And then there's also this Miller's law. It says like, you know, working memory holds like about seven items. It's five plus or minus
two. I think it's called the magic number seven. So, that's a psychological study that says like how many things can you hold in your mind steadily, right? And now like people do multiple agents, multiple repositories, and they're like trying to spin off orchestrate so many agents. Like, why are you laughing? Do you do that? Uh you've seen people do that. It's all It's all for the show.
I I don't know like I've been very skeptical about this. I've been trying to do it, but I think like it's not sustainable. You You'll probably be doing it for a short amount of time. Maybe that time varies. So, for some people it'll be 2 months, and some people it'll be 5 months, and some people it'll be 12 months. But I I really suspect like if you
had a way to measure it, I think like at least the person would be incredibly miserable. Like, that's what I think, right? Like, that's that's what I And like that's what all the studies point out to, right? And even even if you look at the recent trend in the social media like the past two to three days, the people who were advocating for multi-agents are now advocating
that if you can't get two agents work properly, then you should probably not try to do like more than two agents, right? Like, now there is a cap, right? And it's not your fault, but then they're also excited, but then now when they're trying to ship to production, that's when they realize like, "Okay, like we're hitting human limits here." Like, it's not it's it's not even individual
skills, right? Like, and and even if it's individual skills, it's not There's not going to be a lot of variation uh between them. So, there are like not a lot of things that you can hold in your memory, right? uh you also have attention residue. Even if you complete something, when you move to the next type, it's not like compute it's not like clearing your computer clipboard,
right? Like, there's going to be something that is going to keep coming back to you, right? And it could be any kind of things. Like, you know, you still are happy or celebrating the success of the previous task, right? Or maybe you have like new items that you want to fix, even though the task was was completed successfully, right? There is like something that is constantly going
on with you. And the last one is called as the Zeigarnik effect. It's when you unfinished things, those things take the most amount of energy. Like, even if you do 10 different things and you have like two unclip uncomplete or unfinished things, those things are going to come back and haunt to you haunt you for a very long time, right? the simple act of just like moving
from uh single-tasking to multi-tasking doesn't mean your like bandwidth or your capacity has increased. Like, you're also bringing in additional costs that are going to tax your own cognition. So, until January, I was just working on one task at a time, one project at a time. So, that was a very different thing. February and March is where I tried to adopt this multi-agent thing and on multi-agent
code code basis, I did have some success since around it. I would still want to solve for it, but I don't want to be the person who's managing dispatching tasks and all of that. Like, I would probably want to do it in a more sustainable manner. Uh but, I would not go back and try to do whatever I've done in the past couple of months. Yeah, this
is the onset of multitasking. So, um I used to be this person. I would have an extra monitor. And my monitor my laptop would be in a clamshell mode with an external keyboard because I just want to do one thing at a time. So, this like transitioning from being a single monitor person to like having two monitors and then considering to buy a third one and thankfully
I didn't buy a third one. And the burnout happened much earlier. February and March is where I actually started multitasking, right? Like and yeah, so multitasking is not free. There are benefits, but I'm not really sure whether those benefits outfight the cost that you're paying to March is interesting. March is also where I was working with multiple agents, multiple code bases and the long-running task is super
interesting, right? Like when I say I was able to run long-running tasks for like about 6 hours, like mostly 4 hours 3 hours, 6 hours, whatever. Now, when you come back you still have to verify behavior, right? Like even though you have like structure and all of that set up which means you have to verify all the behavior that was built in the past 6 And second
thing is you have a system that you don't understand anymore. Like you don't completely understand it. And for any engineer, even in the AI age, for you to build and evolve systems in a sustainable way and be really good at it you have to understand the system that you build, right? And one of the things that I noticed is when I was working on these code bases,
there were days where I would feel like really heavy in my head. Something very uncomfortable. And I would not be able to extend the system. So, those were times where I scheduled like one or two days and I would like sit with the source code and my notebook and then try to like really understand what is going on, right? Or I would like sit with the agent,
chat with it and ask it like ask questions to the agent and then ask let the agent ask me questions so that I know like I've understood the code base, beyond a certain point and beyond a certain size, like you really can't evolve systems that you're maintaining without a good understanding. So, even though you felt like you got 6 hours and you can do something else, but
then in addition to the 6 hours, you're also accumulating the comprehension debt because now you don't fully understand the system that you built already, right? You can go away with it for a certain amount of time, but there is a time where you still have to pay back the debt. Like we all have our moments where you have to like sit and understand the system or like
people and really understand the system before you can even touch any part of the code base, right? So, even though it feels like okay, long horizon tasks are like very, very interesting. It's a interesting engineering problem to solve, but then the cost is paid in terms of like, you know, comprehension debt, right? Like So, at every single point in time, you notice that it's still a very
software engineering problem, right? Like you have four five bad choices, how do you make three not so bad choices, right? Like how do you work with these constraints? So, even though when you're like using AI agent for your day-to-day use, you're still paying off in ways that you still don't understand and sometimes it feels like I don't feel good or like or I'm like not a good
engineer or not a capable engineer, but these are all the things that are affecting your mind. So, now at least you have a vocabulary to really even think about like what is happening to be, right? And you can course correct and adjust accordingly. So, this is the social media version, but I'm never posted any of this on Yeah, like half a million lines of code over 3
months and like all of this stuff, it all looks This is what the social media is celebrating right now and I think like that's not what it should be celebrating. Even Steve Yegge has written a blog post recently. It's called AI Vampire and he's also saying people, I think like he he he talks about something interesting, okay? I think I've time for this. He says, "Okay, who
is capturing the value that is created by AI? Right? Someone has to capture the value created by AI. Let's say hypothetically you are an who uses AI to become 10x more productive. And you you're 10x more productive. And your friends and colleagues hate you for it because now you're setting wrong wrong examples. You've like moved the ceiling like so high like the evaluation criteria so high. And
100% value goes to your compu- company. Right? You comp- And you get still get paid the same. Like you can not you're not going to get paid 9x what of what you're producing, right? Like So, 100% of the value is is is created is captured by the company, right? Let's take about another extreme example. So, you're a really smart engineer. So, you say, "Okay, like I can
do 10x the work but I'll work for 1 hour every day and then call it a day because like nobody's going to notice and I'm going to get passed by, right?" In this case, you capture 100% of the value, right? But then your company goes under because your competitor's working harder. Right? So, it's a it's a it's a win-lose situation because if you don't have a job,
then you probably have to go look for another job job, right? So, the value capture has to happen somewhere in the middle, right? Because if you go to the other extreme like the one that I showed you earlier, you're probably going to like be burnt out and like uh recovering from burnout is not easy because if you want to replenish dopamine, you need to sleep really well.
You need to disconnect and it takes weeks to actually get back your dopamine to your baseline levels. Like it's not easy. And you also have to like sort of like have good enough good care to get your motivation levels back up because dopamine also influences mo- motivation Uh so so so that's an interesting blog post. It's called AI Vampire by Steve Yegge. So, the balance is I
can only tell my experiences, right? Like everyone is unique and you have to find your where the balance lies for you. And I and I hope this talk sort of gives you some of those ideas. And it's not a comprehensive list. You can still go and look at read about like neuroscience and like a little bit of stuff and how it affects you. Uh but this is
what has happened to me, right? Like decision fatigue, I've experienced dopamine peak. Now there is dopamine depletion also. And then this context switching comprehension type like all of these things I'm the only person that I have to pay off, right? Like maybe my company captured 100% of uh value on the $300 spent, right? But then for me to pay it off it's going to take some time
and um effort. So you feel like task initiation and all it's it's all hard like it In fact like for me it was very hard to prepare for this conference. It was like a wrong uh for me to burn out. But here we are. So these are four primary recovery [snorts] means. Like say for example if you like if your dopamine baseline is depleted then you probably
like you know um emotionally eating, binge watching. Those are some of the things that will you would see like as symptoms when you when your dopamine is depleted. And you'll also like find it things that were very easy to do for you in the past will become extremely difficult for you So sleeping sleeping is really really important like you know try to sleep a lot. And the
decision fatigue reservoir is like it works for someone like like say for example there's one part of a day where I try not to make any decision. It's about like 2-hour window where I don't try to make any decisions Uh but it's very different for different people. So now I consciously schedule zero days in a week. So I would go and look at like you know today
I should do I shouldn't do anything related to work. previously I would not work during uh the weekends but yeah. And yeah so these are some ways you can recover from um these things. And there's there's a bunch of research papers and quotations from that. I will post the slides on social media so you you can get it from Twitter or LinkedIn or even from the Git
folks. Um I don't think we have Maybe we have time for one question. All right. If we don't have any questions then I'm glad to see you here. >> You have your weight has gone sick. >> Yeah. >> It is going away. >> It's gone. Yeah. Yeah. Yeah. Yeah. I I did not want to put the metrics here because those are the wrong metrics for you to
look at. Right? >> For me the metric is like I think like for me the most reasonable number for me to look at would be like you know revenue and like number of customers. For you you have to find like the the only reason I did not talk about those metrics is because like people would selectively pick that number and like those numbers are impressive, right? Like
I I So probably put like somewhere around like half a million lines of code somewhere in between. But I really don't want to over index on those things because those are not the right numbers. >> You have to tell >> I have a I have a number in mind and like it's going to get expensive, right? But one of the reasons I always spend I mean like
I'm okay with spending a little bit more on AI spend is because it's going to get expensive. Like with all the OpenAI's drama and all of that. Uh if if come if OpenAI's goes under then it's going to be a lot more expensive than what we're paying right now. Yeah. >> What do you think? He got He got you like going get big one. That might be
my bad. >> Yeah, I was trying to say like I will still have a job. >> No one will be able to fire me. I'm still relevant even if there is AI in the world. Yeah, that was the thing. That was like a long time ago. Yeah, like my stance is different now. >> I don't want to take Like what that >> That might be a problem.
>> I don't want to take I might be back to be completely one of the things. >> Right. >> I think the topic is I You also need to pay attention. You have to you have the points for >> Correct. Correct. So you also need to have like a level of abstraction that you can look and reason about the code, right? So, see comprehension in my opinion
is a very different topic because you comprehend systems in different ways at different points. Like for example, you understand system when you're writing a PRD, right? You understand the system when you're spiking it out. You're understanding the system when someone raises a PR. You're understanding a system when you're reviewing source code, right? So, and even when you're building your system, you're understanding it, right? So, comprehension happens
so much but in so many different contexts, we don't look at it as a single thing, right? So, that's why when you say, "Okay, someone has handed over me a system. Now I have to understand it." Then that becomes very, very difficult. But if you can sort of boil it down to understanding the structure and behavior separately, the learning is a lot more faster and it's a
lot more easier. You've been a nice great audience. Thank you very much. >> [music]
More from this event
See all 126 talks →
AI Is Not the Risk. Architectural Drift Is - Sunil Kalkunte
17:39
Breaking the Monolith: Tesco’s Journey to Federated GraphQL with xAPI - Vishwas Chandrashekar
29:13
A Practical Introduction to LangChain4j - Venkat Subramaniam
1:01:28
Beyond the AI Models: How Lowe’s is Building the Store That Knows - Swaroop Shivaram
13:59