Latest / The Product Engineering Podcast / What Makes AI Code Production Ready?
Transcript
- 56:14Using AI to build a prototype of
- 56:16something isn't the same as building
- 56:18production code that will
- 56:19last and stand the test of time.
- 56:21Often you can get something 80% of the
- 56:23way there using AI, and that extra 20%
- 56:26could take you many, many times as long
- 56:28than that first 80% took.
- 56:30So don't fall into that trap of thinking
- 56:32that just because you can build a
- 56:33prototype that looks amazing, you've got
- 56:35something you can ship to production.
- 56:37(Music)
- 56:46Hi, I'm James Charlesworth.
- 56:47Welcome back to the
- 56:48Product Engineering Podcast.
- 56:49And today we're going to
- 56:50talk about prototyping.
- 56:52And this is really one for the engineers
- 56:53because I know a lot of engineers have
- 56:55been expressing this opinion for a while
- 56:57now, ever since AI came around.
- 56:59AI is really, really good at creating a
- 57:02nice looking product, but the step
- 57:05between getting that code like out there
- 57:07and looking nice on the user interface,
- 57:09and then getting it into production and
- 57:11being able to support it into production
- 57:12is not as simple as it first seems.
- 57:15Now, software engineers absolutely know
- 57:16this, but product managers and people
- 57:18that aren't necessarily super, super
- 57:19technical from a coding point of view
- 57:21think that just because it
- 57:22looks right, it is right.
- 57:25Now, that doesn't necessarily mean that
- 57:26having an 80% of the way
- 57:28their prototype is a bad thing.
- 57:29In fact, as I'll argue many times on this
- 57:32podcast, being able to create a prototype
- 57:34that looks good and basically functions
- 57:37is an extremely valuable learning tool,
- 57:39but it's not the same thing
- 57:40as writing production code.
- 57:42So let's break down what some of those
- 57:44gaps are and some of those things that AI
- 57:46still can't necessarily do.
- 57:48And we'll work out where you can use
- 57:49prototypes and where you can use AI and
- 57:52where you should
- 57:52probably do things properly.
- 57:54And in fact, it's probably worth going
- 57:56back in time to before AI existed because
- 57:58this problem has
- 57:59always basically been there.
- 58:01Ever since things like React and stuff
- 58:02like that came out, it's been fairly
- 58:04trivial to create a nice looking user
- 58:06interface, maybe with some mock data, and
- 58:09then put that in front of people and say,
- 58:11this is what the
- 58:11product is going to look like.
- 58:13And then a lot of people fall into the
- 58:14trap of thinking that that really quick
- 58:16prototype you made is
- 58:18ready for production.
- 58:19If anyone has ever been to a hackathon,
- 58:21hackathons usually revolve around the
- 58:23smoking mirrors effect of I've made
- 58:25something that kind of
- 58:26looks like it's going to work.
- 58:27This is directionally where we want to
- 58:29go, but we haven't
- 58:30actually written production code.
- 58:32It's extremely difficult even in the age
- 58:34of AI to write proper hardened production
- 58:37supportable code in like a small amount
- 58:39of time, like a one day hackathon.
- 58:41And nothing's really changed there.
- 58:43AI has just turned like a one day
- 58:45hackathon into a 10
- 58:46minute prompt exercise.
- 58:47Ultimately, it hasn't changed the fact
- 58:50that the code that you've written that
- 58:51might look brilliant isn't always ready
- 58:54to go into production.
- 58:55And so what are those gaps?
- 58:57If you've built something using claw code
- 58:59or you built like a user interface from
- 59:01scratch, what are the gaps between what
- 59:03you've built and what looks amazing and
- 59:05what's actually production ready?
- 59:07Well, there's many of them and they're
- 59:08often things like scalability, cost.
- 59:12A lot of the time in AI will just not
- 59:15really care about how much something is
- 59:16going to cost to support in production.
- 59:18So it might give you a super expensive
- 59:20solution that isn't necessarily going to
- 59:21be commercially viable.
- 59:23There's also things like observability
- 59:25and maintainability.
- 59:27So good software engineers will know that
- 59:29in order to support some software into
- 59:30production, you need to instrument that
- 59:32software with observability and metrics
- 59:35and things like that.
- 59:36So that when something breaks in
- 59:37production, you can very, very quickly
- 59:39work out what's going to break.
- 59:41Potentially, you can work out as it's
- 59:43going to break before
- 59:44something happens in the product.
- 59:45All of that observability is hidden to
- 59:47people that are using software.
- 59:49If you're a user of a web application,
- 59:51you probably don't realize quite how much
- 59:53instrumentation and observability is
- 59:55built into that on the back end.
- 59:57And so if you're being shown a prototype
- 59:58of something that was written with AI,
- 1:00:00you don't know whether or not there's a
- 1:00:02way for the person who built that to
- 1:00:04actually monitor what's
- 1:00:05happening on the back end.
- 1:00:06And to predict when things are going to
- 1:00:08fail and when it's going to crash.
- 1:00:09But you do need all that.
- 1:00:11In order to support something in
- 1:00:12production, it needs to be observable.
- 1:00:14It needs to be secure.
- 1:00:16That's another thing
- 1:00:16that often gets missed.
- 1:00:18It needs to be scalable.
- 1:00:19You can build things for
- 1:00:20different levels of scale.
- 1:00:22People, it's a mistake to think that
- 1:00:23scalable is a yes or no decision.
- 1:00:26Code can be scalable to the point where
- 1:00:28you want it to scale to, or it can be
- 1:00:30scalable to like a larger point.
- 1:00:32But you very rarely get a situation where
- 1:00:34code will scale from zero to infinity for
- 1:00:37the same trade-offs.
- 1:00:39Unless you've been really, really
- 1:00:40conscious about giving the AI information
- 1:00:42about how much you want it to scale,
- 1:00:44which a lot of people won't do, then what
- 1:00:46you'll end up with is a piece of software
- 1:00:47that's designed for a certain level of
- 1:00:49scale and you try and implement it to a
- 1:00:51different level of scale.
- 1:00:52Scale works both ways.
- 1:00:54So if the AI has given you a piece of
- 1:00:55software that works for a million users,
- 1:00:57but you've actually only got 100 users,
- 1:01:00that's not necessarily a good solution.
- 1:01:01That's going to cost
- 1:01:02you a lot of money to run.
- 1:01:04The infrastructure is going to be
- 1:01:05extremely complicated and expensive, and
- 1:01:07you've only got 100 users, so you're not
- 1:01:09getting that benefit.
- 1:01:10Equally, if it's built you something that
- 1:01:12will only work for 100 users and you try
- 1:01:14and roll it out to a million users, it
- 1:01:15will break there as well.
- 1:01:17So you need to be able to
- 1:01:17design for the correct scale.
- 1:01:19And again, that's one of those hidden
- 1:01:21pieces of architecture that isn't
- 1:01:23apparent in something that
- 1:01:24was just vibe-coded with AI.
- 1:01:26So you can have a product that looks
- 1:01:28functionally brilliant, but all of those
- 1:01:30questions around scalability and security
- 1:01:33and observability and maintainability,
- 1:01:35all of those are hidden and you don't
- 1:01:36know what those decisions were or if
- 1:01:38those decisions were even
- 1:01:39made in the first place.
- 1:01:41So it's really important for everyone
- 1:01:43that's building software rapidly with AI
- 1:01:45to just be aware of those kinds of
- 1:01:47decisions that need to be made in order
- 1:01:49to make something production-ready.
- 1:01:51So you have the user interface that
- 1:01:53you've built and you've maybe got some
- 1:01:54back-end functionality, then ask yourself
- 1:01:57how are we going to make sure this
- 1:01:58scales, how are we going to make sure
- 1:02:00it's secure, how are we going to support
- 1:02:02it in production, what are we going to do
- 1:02:04when something goes wrong, where the data
- 1:02:06have actually been stored, which the
- 1:02:07parties are using, all the legal stuff.
- 1:02:10All of those kinds of questions need to
- 1:02:11be answered in order to take your
- 1:02:13prototype into production.
- 1:02:15Now that doesn't necessarily mean you
- 1:02:16shouldn't do it, you absolutely should
- 1:02:18build prototypes because sometimes you
- 1:02:21don't need all of those other questions
- 1:02:23to be answered in order to
- 1:02:24get value out of a prototype.
- 1:02:26So a prototype that's been built with AI,
- 1:02:28if you're working on a product
- 1:02:29engineering team and you're working in
- 1:02:31quite an unknown environment, an AI-built
- 1:02:34prototype can give you something that's
- 1:02:36more valuable than anything else,
- 1:02:37probably more valuable than the
- 1:02:39production code and it can give you
- 1:02:41answers, it can give you learning.
- 1:02:43So if building a prototype allows you to
- 1:02:45explore an idea or it allows you to
- 1:02:47answer a really pressing question about
- 1:02:50the correct path forward in your product,
- 1:02:52then you should do it.
- 1:02:53If you want to put that into production,
- 1:02:55then you need to actually answer all of
- 1:02:57those other questions.
- 1:02:58So you need to make it scalable, you need
- 1:03:00to make it secure, you need to have
- 1:03:02observability and all
- 1:03:03of the other things.
- 1:03:04Even at a code level, it can be useful to
- 1:03:06make sure that you've got the right
- 1:03:08coding practices and the code's clean and
- 1:03:10readable and doesn't duplicate itself and
- 1:03:13all the kinds of things that software
- 1:03:14engineers care about, that's what goes
- 1:03:15into production product and that kind of
- 1:03:18stuff is completely invisible to the
- 1:03:19person using the prototype.
- 1:03:21So the solution to this is just to make
- 1:03:23it explicit what is included and what is
- 1:03:26not included in some
- 1:03:27software you've written.
- 1:03:28If you've built an application very, very
- 1:03:30quickly to test out a concept, then just
- 1:03:32make it explicit that this might not be
- 1:03:35100% scalable, it might not be
- 1:03:36maintainable, that's okay, as long as
- 1:03:38you're saying that that's why we've done
- 1:03:40it, then you can still get the learnings
- 1:03:42and the value out of that product.
- 1:03:44Two pieces of product might look exactly
- 1:03:46the same, two pieces of software could on
- 1:03:48the surface appear exactly the same, but
- 1:03:51one of them is production ready and one
- 1:03:52of them is not and you wouldn't
- 1:03:54necessarily know from the
- 1:03:55outside whether they are or not.
- 1:03:57So that's where the skill
- 1:03:58of engineering comes in.
- 1:03:59So if a product manager, for example, is
- 1:04:01prototyping something with AI, then the
- 1:04:04role of an engineer on their team is to
- 1:04:06help them guide them down the right
- 1:04:08questions they need to answer before
- 1:04:10that's ready for production.
- 1:04:12Now I spoke on a previous episode about
- 1:04:13context and accountability.
- 1:04:15If somebody is making a decision to build
- 1:04:17something inside your product, then you
- 1:04:19do really want to empower them to be able
- 1:04:21to make that decision.
- 1:04:23But they don't always know the context
- 1:04:24behind whether that's
- 1:04:26the right decision or not.
- 1:04:27So it's the job of the organization to
- 1:04:28create a structure in which people that
- 1:04:30know about security and observability and
- 1:04:33scalability and support, those people can
- 1:04:35provide that context to the people that
- 1:04:37are going to make the decisions about
- 1:04:38whether or not it should be built.
- 1:04:40So ultimately, if you've got a product
- 1:04:42engineering team with software engineers
- 1:04:44that know all about the architecture and
- 1:04:47the correct way to scale something, and
- 1:04:49they've got product managers that maybe
- 1:04:50know the correct thing to be building,
- 1:04:53bringing those two together and allowing
- 1:04:54them to share that context will allow you
- 1:04:56to build things that are
- 1:04:58initially not production ready.
- 1:05:00And then once you know it's the right
- 1:05:01thing to build, you go
- 1:05:02make them production ready.
- 1:05:04So it's ultimately a two stage process,
- 1:05:06you build something that looks finished,
- 1:05:08and then you go and make
- 1:05:09it finished afterwards.
- 1:05:10And those two things can be very, very
- 1:05:12different levels of effort.
- 1:05:13Sometimes the amount of effort that goes
- 1:05:15into building an AI prototype is more
- 1:05:17than you think it is.
- 1:05:18So just because something looks like it
- 1:05:20was vibe coded with a one shot prompt
- 1:05:22doesn't necessarily mean that that person
- 1:05:23hasn't spent a lot of time
- 1:05:25exploring different ways.
- 1:05:26So don't disregard the amount of effort
- 1:05:28that goes into building an AI prototype
- 1:05:30because they can sometimes involve quite
- 1:05:32a lot of learning, quite a lot of
- 1:05:33iteration, quite a
- 1:05:34lot of experimentation.
- 1:05:36There's a lot of back and forth talking
- 1:05:37to an AI is still working.
- 1:05:40So don't disregard the fact that
- 1:05:41somebody's got a good prototype, just
- 1:05:43because it's not production ready.
- 1:05:45But at the same time, don't disregard all
- 1:05:47of the work that you need to do to make
- 1:05:49some software production ready.
- 1:05:51It's really, really important not to have
- 1:05:53this smoke and mirrors effect, where
- 1:05:55you've built
- 1:05:56something that looks amazing.
- 1:05:57And then everybody just
- 1:05:58assumes it can go into production.
- 1:06:00Sometimes things can, but they won't
- 1:06:02always go into production in the way that
- 1:06:04you necessarily need them to.
- 1:06:06There are a lot of platforms out there
- 1:06:07that will give you a in air quotes
- 1:06:09production ready piece of software.
- 1:06:11But that doesn't necessarily mean that
- 1:06:13it's the right production ready piece of
- 1:06:14software for your organization, for the
- 1:06:16level of scale that you're going for, for
- 1:06:18your particular regulatory
- 1:06:19or security requirements.
- 1:06:21None of that sort of stuff is guaranteed
- 1:06:23just because something looks production
- 1:06:25ready, or just because you're using a
- 1:06:26tool that has told you
- 1:06:28it's production ready.
- 1:06:29So ultimately, it comes down to a balance
- 1:06:31between over
- 1:06:32engineering and under engineering.
- 1:06:34Something that looks amazing, but doesn't
- 1:06:36have all of the scalability and the
- 1:06:38production ready stuff
- 1:06:38in it is under engineered.
- 1:06:41But something that is super, super
- 1:06:43scalable and really observable and
- 1:06:44supportable in production, but doesn't
- 1:06:46necessarily need to be at this point,
- 1:06:49that will be over engineered.
- 1:06:50If all you're trying to do is learn
- 1:06:52something, if you're trying to learn if
- 1:06:54this is the right feature to be building,
- 1:06:56then you don't necessarily
- 1:06:57want to over engineer something.
- 1:06:59It doesn't need to be fully scalable if
- 1:07:01you're only going to try it
- 1:07:02out with a handful of users.
- 1:07:04So don't over engineer stuff.
- 1:07:06Don't allow software engineers and people
- 1:07:08that really want everything to be super
- 1:07:10production ready to slow you down.
- 1:07:12Don't allow those people to stop you
- 1:07:14trying out prototypes and things with a
- 1:07:16subset of users with
- 1:07:17the outcome of learning.
- 1:07:19But equally, don't allow people that have
- 1:07:21built a prototype to just ship it to
- 1:07:23production without thinking about all
- 1:07:25those other things as well.
- 1:07:26The most important thing you can do
- 1:07:28practically is to make the definition
- 1:07:30explicit between production
- 1:07:32ready code and a prototype.
- 1:07:34So when you've got something that's been
- 1:07:36built, really genuinely document what is
- 1:07:39stopping this thing going into production
- 1:07:41today, and what do we
- 1:07:42still need to build?
- 1:07:43You don't want every new prototype to
- 1:07:45have a list of checked off items saying
- 1:07:47it's ready for production because
- 1:07:49probably that prototype took way too long
- 1:07:51to build and it's not going
- 1:07:52to give you effective learning.
- 1:07:54But obviously you don't want a prototype
- 1:07:55that has a bunch of unchecked boxes
- 1:07:57because it's not ready for production.
- 1:07:59So if this is something that resonates
- 1:08:01for you, if you've seen people trying to
- 1:08:02ship prototypes to production when
- 1:08:04they're not ready, or you've seen people
- 1:08:06over engineering a prototype because
- 1:08:08they're being told it has to be
- 1:08:09production ready when it doesn't
- 1:08:10necessarily have to
- 1:08:11be, then do let me know.
- 1:08:13My email address is
- 1:08:14james at train2code.com.
- 1:08:16I really welcome feedback on this product
- 1:08:18and this podcast, and I really, really
- 1:08:20want to have other
- 1:08:21opinions and other voices on this.
- 1:08:22I am booking guests for the future, so if
- 1:08:24you want to guest on this,
- 1:08:26then reach out to me as well.
- 1:08:27My name is James Charlesworth, and this
- 1:08:28is the Product Engineering Podcast.