What sorts of things am I using AI for these days in my software development? I have a few core use cases, but I would love to hear yours too!
📄 Auto-Generated Transcript ▾
Transcript is auto-generated and may contain errors.
what is up it's another day without any commuting I didn't go to CrossFit today so I missed out on two drives um I had a bit of a work thing come up last night and I thought I had to make myself available pretty early in the morning to meet with someone in the UK turns out I was wrong um so then I yeah I ended up missing CrossFit but it turns out the workout was pretty crappy anyway and I wouldn't have liked it so not All Is Lost but I have a topic I'm going to go through from Reddit I think this one's kind of interesting uh might be pretty relevant for a lot of people because it's AI related and um so I'm going to share my perspective on this stuff um and the question is really just about like what it says what
are y'all actually using co-pilot for and um I guess when I go to answer this too I'll maybe for you to think about like let's leave it kind of open-ended not necessarily co-pilot um I use co-pilot but I also use other things too um I'm not using I don't know like cursor AI or uh there's a bunch of stuff right there's a million things now um so my set of tools is pretty limited that I use regularly I'll talk through that um give my perspective about how I find things are useful when things stop being useful and uh yeah hopefully that's helpful um and I figured you know trying to do a good job of reminding people about this stuff when I get into these videos but if you want questions answered just comment below I'll do my best to do that uh a huge
shout out um I had uh someone man I should have I'm drawing a blank now and I should uh should pull it up on my phone um but I had someone actually leave a tip which is cool I just got monetized on this channel for the first TI of monetization uh which is super cool um and I'm close to the next actual tier of monetization which is awesome oh sorry web developer ninja 9220 uh huge thanks uh to to be able to put out some content and get a tip for it was actually just doing a uh like sort of I do these Vlog entries for my main Channel I've been doing them every week for for two years now um except for like a couple of instances where either I've been sick or like on vacation and I was saying in that Vlog entry
like how cool it is to be able to have you know it doesn't matter what the dollar amount is but for someone to leave a tip go out of their way and say thank you like that means a lot to me so um yeah thanks for doing that but if you want questions answered leave in the comments if you have something more in depth that you want me to go into just send a message look for Dev leader on social media and then another quick reminder that if you like this style of video that my main Channel Dev leader uh Mondays at 7 p.m. Pacific I do a live stream and it's an AMA format so it's like this except there's a chat and then you can chat and I'll answer any questions that you have um I have topics every week that come from my newsletter it's at weekly.
deev leader . CA no you do not need to subscribe to it but if you want to know what the topic is for those live streams it goes out every Saturday so you have Saturday Sunday Monday to check it out that's the primary topic and of course if people have stuff in the chat they want answered I I focus primarily on that so with that said co-pilot what do I use it for what are the things do I use um so I do use co-pilot in visual studio um for me the the best use I get out of co-pilot and any AI tools right now is basically just glorified autocomplete which maybe sounds like well that's not really that helpful is it like we already had like intellisense and autocomplete like what do you really need um but I actually I realize like how much
I how much productivity I get out of it now and I think it's probably a couple of months ago now but I was coding and for some reason maybe my internet was down or something I don't know but the co-pilot stopped working maybe it was a vis something with Visual Studio who knows but it stopped working and I remember I'm like whatever like it's just co- pil it like great okay fine let me just keep going but I felt like and it was such a weird feeling I was like it feels like I'm typing code in notepad now and if you've gone from using an IDE with all your bells and whistles that help you kind of just move along and be more effective when you're coding it just kind of felt like I don't have thumbs anymore like how I can't how am I
how do I write code like what am I even looking at so it was this really weird experience for me where I didn't realize how much I'm relying on co-pilot purely from an autocomplete perspective and I think like for some people again they might say well that's who cares like that's not really that valuable to me or or it's autoc completing and it's always garbage or something but I think the way that like the reason it's working well for me is at least in the code that I'm writing I find there's a lot of I'm going it might be a weird word to use but you'll probably understand like there's a lot of common shapes in my code um and I I literally mean like if you were to blur your eyes and look at the code there's a lot of shapes that are common
so and a lot of these are like different patterns that come up in code right so different design patterns maybe I'm making a repository or I have something like a facade that's wrapping different plugins to call into um it could be could be any number of things right unit of work pattern like whatever um and and because I name things like relatively consistently um I don't know like it seems like I go to open up a new file and start creating a class I start typing a little bit and it like seems to do a pretty darn good job of predicting what I want and many times it won't have the right you know Big Blob of texts that I want to go do maybe the method that it's suggesting I don't even want that so I'm like cool let me just like Type A
different name for the method and as I'm changing it it's like sort of rewriting the code that's inside and a lot of the time it's pretty close at least to the shape I want and again maybe it's just like how I'm writing code the fact that I'm using C or just the patterns and stuff I use but even if I let that auto complete and I go back and I'm just tweaking a few things it's actually significantly faster than me just typing everything by hand and going line for line um maybe part of the reason for that too is like if there's boiler plate or whatever else going on it's almost like I'm getting this second path of like reviewing the code if that makes sense like the code is written and I'm going now I'm reviewing and and updating it versus me just typing
it for the first time and going through so I I genuinely find that just that alone using co-pilot and visual studio is speeding up my productivity tremendously from an autocomplete perspective so I love using it for that um I actually did a podcast interview today with someone named Alex Lao who is a an an author of a book it's uh but in the in the conversation we were talking about AI tools and we talked about like how are we using AI tools so it's kind kind of fresh in my memory to talk about this but um he said hey like what about that feature where like you can basically in in Visual Studio you can kind of pull up the the chat and like ask AI like you can prompt it in a chat to like do something with code and I said I actually
don't use that and it seems kind of silly because it's not that I don't use it for the use case I actually um I find for some reason the autocomplete is lightning fast and that chat integration is like dreadfully slow it's slow enough that I actually just work outside of visual studio and co-pilot for this part so instead of like opening up the co-pilot chat and asking questions about my code what I generally do is I just open up a chat GPT window I type a prompt and then I copy and paste code in it's like the same thing it's less integrated and um and it I think it works for me because the responsiveness is way faster I don't know why that meth like that approach in Visual Studio was so slow for me especially given that the auto complete is like so fast
but um I don't know so like it's not that I don't want to use it it's just right now the functionality is not lined up with what like uh what's effective for me so I I don't do that um but I do use chat GPT in that case and again I should call out I'm not like this is not for work so I am not using like taking Microsoft's code base and dumping it into chat gbt or anything like that this is for my own stuff my own development outside of work um anything that I'm making I don't care if AI wants to to learn on it so be it uh I don't have any any Trade Secrets up here for proprietary algorithms that I don't want people having access to from AI being trained on it so whatever uh if that's a concern for
you then think about what you're doing and and what you're sharing so um something to think about but not really a factor for me um but what types of things am I using in in that scenario where I'm saying hey co- well not co-pilot in this case but hey chat GPT because that co-pilot path is kind of slow for me like what am I asking it to do um and there's a handful of things that I find um a less common one but I still use it is a asking it to refactor code um and there's going to be a theme in some of the things that I'm going to talk about here um but I I I'll ask get to refactor code sometimes uh to give an example of of what that looks like so in C if you're not a net or C
developer you might not uh totally get this reference but there's something in C called link language integrated query I think is what it stands for I think so um and basically if you're working with collections of things uh you can basically have this it almost looks like a streaming API so um instead of necessarily working with materialized collections which which you still can do um you can basically stream data through almost like a pipeline uh so VAR succinct um syntax uh you don't have to think instead of writing out like a for Loop like four each one of these things go do something the the thought process is like you're you're basically doing like map reduce kind of operations and filtering like in your language integrated query so it's it's pretty nice it's succinct um but historically there's been performance overhead with link um I
think in every time there's a new net version I think all this stuff gets way faster which is cool but um there is overhead for using it um so there have been some situations where in my code base I've written link and it's on a hot path and I will say hey like hey chat GPT here's some code refactor this to use no link and instead use materialized Collections and one of the reasons that that works really well in those situations is like there is a a basically like a guaranteed finite set of data that we could be working with so there might be queries that only ever pull up to like a 100 records at a time right I'm not going to accidentally stream an entire database of Records into memory maybe there's 100 records at a time so I'm like just go pre-allocate
the 100 record list like just go do that and then I don't need link to basically on the Fly go oh let me keep resizing a list or something just little things like that and I can ask co-pilot like hey just go refactor this to have loops Instead pre-allocate The Collection sizes and consider performance right like basically prompting it like this is a performance critical code path go do it now can I do that myself absolutely do I care enough to do that myself no do I find that interesting to do no um so again you'll see a bit of this pattern coming up it's like things that I I understand how to go do it but I don't want to spend the time on it and it's not interesting so if I can ask like AI to do it great and then I spot
check it right like because I know I know what to look for it's just I don't want to go do it um so that's one use case it's actually less common uh that was one of the more common things in the beginning but it's less common now um and again not because I not because I don't find the value in it it's just because I have other things I do more um so one of the next things is like I talked about this before but um a lot of net and C developers use something called Entity framework core this is a an OM which is an an object relational mapper so when you're taking data from a database and you're you want to map the data into like records in memory to work with um that's what you use an omm for so um Entity
framework cores is the most popular one um they basically structured things in a way that you don't even have to understand um SQL you don't have to you don't have to even see a SQL query ever necessarily and you can use ND framework core and use it effectively and it's great um I don't like using it and I don't like using it and this is this is a me thing it's not like I'm saying I think any framewor core is great it's just not for me uh I'm out of practice with it so that's arguably the biggest reason why so that's my bias I need to acknowledge that uh I'm not practiced with it um I use something called Dapper which is another om and Dapper and Entity framework core can do this by the way um but Dapper allows you to write your SQL
queries in code and then it will do the mapping for you so there's significantly less like magic if I can call it magic in Dapper and uh compared to nty framework core and I like having my SQL queries in my code some people are very much against that they're like I don't want to see that we shouldn't have to think about that it's totally cool I'm not I'm not here to tell you one way is right or wrong I'm just telling you what my personal preference is so you understand where I'm coming from on this now I like sqle queries in my code do I like writing SQL queries no um do I like optimizing SQL queries even more no I don't like doing that I just like making sure I have them because I can read through them understand what's going on like I
like that stuff not feeling like magic to me that's that's my bias that's my opinion is what it is um and I bet you if I could use Entity framework core very effectively I would change my mind but I can't I shouldn't say can't I cannot currently because I don't practice doing it but it's a bit of a vicious cycle cuz go to build something and I'm like ah it's a pain in the ass like let me just go back to Dapper so um this is another example I will take stuff and I could even do something like take the table schemas for my SQL database so copy some tables into a prompt and then I will say to chat gbt I need to write a SQL query it's uh and I can even tell that I'm using C and Dapper uh I want to
minimize round trips to the database and I would like to query data that has this shape here are the tables like the schema of them and then basically give it some some rules on like what to match and because like the the naming Convention of the columns and stuff with IDs for matching is is pretty consistent a lot of the time it figures this stuff out which is super cool um I don't have a really good example some stuff in brand ghost that I'm building has like um I don't know like filter criteria or like things that are related to the schedule um based on what I'm doing and like sometimes it can pick up like oh you have an enable like is enabled column or something right like cool like I know that you're going to want or I'm assuming you want to check
that as part of this query so let me only look for things where it's enabled like I didn't even tell it that and it's kind of picking up on this stuff um so this is something that I really like using because it gets me a bunch of SQL really fast more often than not if as long as I give it the right schemas and stuff it does a really awesome job um there are and this is maybe kind of where I'll pivot on this example for some some drawbacks but there are absolutely situations where uh it'll give me back at query and it's like it's a pretty complex operation I'm trying to do and I'm trying to trying to be sneaky and like could I go write this on my own and do like multiple round trips to the database like the answer is yes
but I'm I'm trying to like squeeze a little bit more out of AI and I'm like hey look I know how to do this in three queries like I want you to do it in one I want you to be optimal I want you to do one query minimize round trips go do it for me and it's like sure here you go and it's not quite right like it runs it compiles it run I guess compiles yes um it runs on uh on the database server but then the results aren't really what I want so this is where it starts getting a little bit dicey and I have had some pretty frustrating experiences with with chat GPT doing this where I'm like okay like that's not right and sometimes based on how complex the query is I actually can't tell where it's wrong in the
query but what I can do is look at the results and say okay like for example this column is duplicated across all the rows and I'll tell it like hey it shouldn't be and sometimes like something that simple it's like oh like thanks for pointing that out and it will go regenerate part you a small part of the query it fixes and then all of a sudden everything's great cool that's a pretty happy path I don't mind if I have a couple of back and forth things like that where it gets frustrating though is like where it corrects something like that and then breaks something else so then I'm like ah okay like you fixed the thing I said but now this doesn't work and it's like oh sorry and then it like un basically undoes it and then I'm like okay well now we're
back at the beginning and then it's like oh sorry and then it tries another variation but the thing is I'm like as it's doing this I'm I'm basically figuring out on my own like what's wrong with the query as it's doing it and I'm watching what it's trying to correct and I'm like it actually is all over the place it's almost like it's guessing it what to go fix kind of like I would be doing um except like in this situation I I'm like relying on it to like realize like what's wrong with it so um that ends up being a pretty frustrating experience and sometimes what happens is like it goes so far down a path I can't get it back out if that makes sense so I've been prompting it I'm like no you're still doing it wrong like this column needs to
be like this or this thing needs to be changed like this or these dates aren't being filtered and it's like oh like okay and then it keeps trying and it keeps like going down this rabbit hole and I'm like we can't get back um so um there are times like that where like I'll basically just close off that conversation and then I'll start something brand new so that it doesn't have all that context and then I try to take some learnings from that conversation I'm like okay I saw that it went down this path that I couldn't get it to recover from so maybe I can structure my initial prompt to like keep it from going so far down that path um like right from the beginning so it knows to kind of avoid it so I've had a little bit of success with that
but um overall it's tremendously helpful for SQL queries it's just that I've had some some frustrating times like trying to salvage the conversation um so that's like one huge use case for me is SQL queries and another one that I'll mention um and it's actually very similar in terms of how it comes up but it's regular expressions and if you're sort of newer to software develop velopment and you're like well what's a regular expression you're in for it um Regular expressions are used for uh basically like pattern matching in string data and instead of doing like does this string contain like this subst string just as an example you can do things like uh you use pattern matching to say like does a string have this shape of data somewhere in the string and so regular Expressions can get outrageously complicated um they can have
huge performance implications because uh of how they're structured like there's there's so much room for things to to go wrong with regular Expressions but um in a bunch of stuff that I've done uh like so my background from before Microsoft was creating digital Fric software so um I spent a long time looking at unstructured data and sometimes very structur data but you know looking at data basically and saying like what is the pattern to pull out you know something contiguous that we can make sense of uh and if it's not contiguous how do I jump around and get the right parts to make it structured so I've spent almost a decade doing that kind of stuff um in some capacity but regular expressions are a thing that like I'm not an expert by any means in the syntax but conceptually they make a lot of
sense to me in terms of like when I would want to use them or when I think something like a regular expression would be helpful so I I use regular expressions for a bunch of stuff but like I said I'm not an expert in the syntax of of working with them right it's not it's not something I use so regularly that like I auto it's like a muscle memory it just like comes out of my fingertips and I write perfect regular Expressions definitely not um so my normal pattern is that I would go to use a Rex visualization tool I like using Rex hero for like net regular expression matching give it some sample input give it uh you know start typing the regular expression I can see it visualize the matches and stuff and that works great for me but with with uh and
I use a bit of this is actually a mix between co-pilot and visual studio and chat gbt um for the basic stuff sometimes directly in Visual Studio I could have an example of a string to give you an example maybe I have a URL and I want to pull out some parts of the URL just making up an example that might be straightforward enough that like I can put like slash slash for a comment put the URL on a new line I could do slash slash and say like use regular expression to extract you know this shape or part of the URL and then press enter and co-pilot will go okay like make a new Rex here's the pattern and stuff um so that works pretty well for simple stuff and I personally have found that it it does a really good job with regular
expression creation and then for more complicated things like I can do the same type of thing but I just type it into a chat GPT chat and I'll say hey I'm writing in C anduse a regular expression to uh extract this type of data from um from a you know what some type of input whatever it happens to be and then say something like create create a regular expression that can do this here is like a bunch of examples of input and does a pretty good job I think it doesn't even better job if you can say here's the input here's the expected output then I can do a extra good job but I I find that both of these tools chat GPT or co-pilot for me work very well for regular Expressions um sometimes I do have this same type of issue where it
goes down a rabbit hole where I'm like hey you're you're matching this thing now but you're not matching this other thing and it kind of flip flops back and forth that's kind of frustrating but overall pretty good so my use cases primarily are around um refactoring uh SQL query generation especially for optimizing them to do them in single round trips because again sometimes I'm like I'll look at my code and I've written you know a bunch of code over time and I'm pulling data from uh you know a couple different methods and I'm like wait a second like that's you know two three four round trips to go get this data like can I do it in one um hey chat GPT so that's a a use case for me and then uh regular expressions are another uh obvious one um other than that like
those are the I would say like the main things that I do like very regularly um I think there's been like something that I I want to use it more for but um it's kind of hard to to trust it and I'm not exactly sure like why that's the case is like sometimes if I need to experiment with building like a new feature in brand ghost just to give you an example I'm like hey I want interact with this API or hey I want to build a system that does something like whatever um sometimes I feel like I and maybe it's my prompting isn't good enough but I feel like I'm not getting answers that I feel good about especially if I'm like hey like I want to use an API for something sometimes it just makes up the API and I'm like okay like
that's not real so it's completely useless so stuff like that is kind of like H like why am I using a for that um but I I do think sometimes for idea generation it can be kind of handy so um if I generalize classes of problems sometimes it can help me think about things so to give you an example um I might be able to say hey I have um I have a service that is that could be multiple instances and um I have I have a situation where I have in normal use cases I have one producer for a queue and multiple consumers I need to make sure that uh only one consumer can ever operate on a message but there are also some situations where I could have multiple producers and multiple consumers like can you can you walk me through some different
uh design patterns distributed systems things to think about um so having conversations like that is something I'm trying to do more of I think and I think part of the reason for that like why it works really well for me or why I'm hoping it will continue to be a good use case for me is that uh because of how I'm writing software now like as an engineering manager at Microsoft I don't write code and that means over the past four and a half years at Microsoft I have not been writing code all the code I'm writing now these days is completely outside of work and I write lots of code outside of work but it means means that I'm like almost in a bit of a vacuum yes I work with a couple of other developers on some of the things that I work
on but we almost like because we're we're a small team like we work on very separate pieces so I am I'm finding over the past few years I'm getting less like input if that makes sense so almost feels like a bit of a vacuum and what I'm trying to do is make sure that I can leverage AI to say like cool like you know if I I stay in my vacuum I will keep building software that kind of looks like this so how can I disrupt some of that flow right how can I get more ideas injected into this um because I think that's probably just something I'm lacking from from how I'm writing code in terms of my environment so um I will continue to do that uh but definitely curious you know I think those are my my primary use cases definitely curious
to hear from you like do you use completely different tools um do you do you find that different llms like between chat GPT and Claud and and whatever else like are they giving you like you know noticeably better or worse um results when you're using them uh I'd be curious to hear about that but yeah the tools the use cases all that kind of stuff if you have uh examples of that please leave them in the comments if you made it this far in the video because uh I think it would be neat like again one of these things I can learn from you guys in terms of what you're what you're doing but yeah I hope that's kind of interesting those are the primary use cases I have um I only expect they will grow so um yeah I'm kind of excited I think
AI is uh is fascinating that we can leverage tools like this for productivity so we'll see where things go so thanks so much for joining in remember Mondays 7 PM Pacific on the main Dev leader YouTube channel for the live stream hope to see you there um show up in the chat ask me questions say hello would love to chat with you take care
Frequently Asked Questions
These Q&A summaries are AI-generated from the video transcript and may not reflect my exact wording. Watch the video for the full context.
- What is the primary way you use GitHub Copilot in Visual Studio?
- I primarily use GitHub Copilot as a glorified autocomplete tool in Visual Studio. It helps me speed up coding by predicting common code patterns and boilerplate, allowing me to review and tweak the suggested code rather than typing everything from scratch. This autocomplete functionality significantly boosts my productivity.
- How do you use AI tools like ChatGPT for SQL query optimization?
- I use ChatGPT to help refactor and optimize SQL queries, especially to minimize round trips to the database by consolidating multiple queries into one. I provide table schemas and specific requirements, and ChatGPT generates queries that I then review and tweak. Although sometimes the generated queries need corrections and can lead to frustrating back-and-forth, overall it saves me time on complex query writing.
- In what ways do you utilize AI for regular expressions and code refactoring?
- I use AI tools like Copilot and ChatGPT to generate and refine regular expressions, especially for pattern matching in strings, which can get complicated. For code refactoring, I sometimes ask AI to rewrite code for performance improvements, such as replacing LINQ with loops in C# for critical paths. These uses help me save time on tasks I understand but find tedious or less interesting to do manually.