Current section: Real World Examples 15 exercises

Making Technical Decisions with AI

As a web developer, the challenge is often not lack of options, but rather an abundance of good ones.

Whether you're facing a dilemma in your technical stack or trying to decide the best approach for a new feature, having a sounding board can be incredibly helpful—even if it's an artificial one.

Loading lesson


00:00 As a web developer, you're constantly making decisions between two options that seem like both pretty good, but you're not sure which one to go with. And I face this a lot with the EPIC stack as I'm trying to decide, okay, which one of these things do I need to do? And using an AI

00:16 assistant can really help you think through things, even if you have a pretty good understanding, or you think you have a pretty good understanding of the options, just having an AI assistant that you can talk back and forth to can help you think through the different options. So for example,

00:31 I was deciding between using a UUID versus a CUID for the IDs, the primary keys that we have in our database in the EPIC stack. I decided on the CUID and I had this conversation with ChatGPT to help

00:46 me make that decision. And so I have this in here, I say, please argue both sides of CUID versus UUID debate. And what this does for me is it helps me to ensure that I may have all of these reasons,

01:01 these pros and cons in my head, but maybe I'm missing something. And so asking an AI assistant to argue both sides kind of helps me think about, oh, maybe that was something I hadn't actually considered yet. I actually do this on Twitter a fair bit too. And that can be quite helpful

01:21 if you have a large enough following of people who are interested in engaging with that. But having an AI assistant that has been trained on the world's information can also be really helpful. And so you can look at the favorable aspects of one versus the other and say, oh,

01:37 those favorable things don't really matter to me or whatever in my particular case. So that's one situation where I used an AI assistant, kind of helped me make a technical decision that was pretty straightforward. When I decided to use a time-based one-time password algorithm here,

01:56 that was a fair bit more complicated. So I'd done one-time passwords for doing magic links and stuff before, but the approach that I took, I wasn't super thrilled with. And so I wanted to make sure

02:11 that I was thinking about all of the implications of like from security perspective and everything. And so I explained kind of my outcomes here, but this also involved a conversation with chatGBT debating a time-based one-time password versus encrypted payloads in the URL, which is what I

02:30 had done before. And so I explained the whole situation to chatGBT with as much useful context as I could come up with, and then asked the question like, what do you think about this approach and what are some things that I'm missing? And so chatGBT can kind of answer

02:49 those questions, give me a couple of things to think about, some challenges that I have, but then you can continue and go through with some follow-up questions. So I hadn't actually considered this sort of problem and like, what about this other thing? And you can just keep

03:06 going back and forth. And this conversation ended up going like quite a ways into it. And I even asked it here to implement a couple of things. I wanted to reduce the number of dependencies. So I said, hey, make sure that you're removing dependencies here or whatever, like how

03:23 complicated is it to implement this? And ultimately I ended up forking another library to create my own version of the way that I do things. I also started out this conversation saying, hey, I don't want to touch the database for this. And then eventually chatGBT convinced me that I actually

03:41 did need to have a table for one-time passwords and the information in there, like the secret key and verification target and stuff like that. And all of this ended up being a part of the

03:52 implementation of the TOTP verifications that we have as part of the Epic stack. And so it does definitely take a lot of going back and forth with the AI assistant for stuff like this. And like I

04:07 said, this conversation got pretty large, but that's the sort of thing that you can do with an AI assistant that is a little difficult to do with an individual. You may have an expert here, but the AI assistant has been trained on the world's information. And so you can go back and

04:26 forth really quickly with the AI and then dive in a little bit deeper into actually implementing it and seeing some of the problems. And then you can take that to an expert as well. Once you've kind of gotten your feet wet in this topic that you may have some experience in, but want like sort

04:44 of a second opinion. So that is another tip that I would give you is like definitely spend some time going back and forth and using chatGBT is kind of like a rubber duck that talks back when you're trying to make these sorts of important decisions, technical decisions between a couple of different