<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: John Slowik</title>
    <description>The latest articles on DEV Community by John Slowik (@jslow421).</description>
    <link>https://dev.to/jslow421</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F193209%2F3f68b056-49ec-4ec1-aca5-cf925de889a2.jpeg</url>
      <title>DEV Community: John Slowik</title>
      <link>https://dev.to/jslow421</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jslow421"/>
    <language>en</language>
    <item>
      <title>Judge Me by My Size, Do You? What Your Viewport Really Costs an AI Tester</title>
      <dc:creator>John Slowik</dc:creator>
      <pubDate>Mon, 16 Nov 2026 21:03:50 +0000</pubDate>
      <link>https://dev.to/jslow421/judge-me-by-my-size-do-you-what-your-viewport-really-costs-an-ai-tester-27hd</link>
      <guid>https://dev.to/jslow421/judge-me-by-my-size-do-you-what-your-viewport-really-costs-an-ai-tester-27hd</guid>
      <description>&lt;p&gt;Yoda told Luke that size matters not. With all due respect to the little green guy, he never had to pay for a computer-use agent's screenshots.&lt;/p&gt;

&lt;p&gt;Here's how I ended up down this rabbit hole. I recently pointed Claude at a web app to do some functional testing, and my usage went &lt;em&gt;way&lt;/em&gt; up. My gut said screenshots were the culprit: the agent has to look at the screen before nearly every move, and every look costs tokens. So my tongue-in-cheek pitch for a blog post became "monitor size actually matters for AI-driven testing." But talk is cheap, so I had a small team of AI agents build and run an experiment to prove or disprove it. Let's see what happened.&lt;/p&gt;

&lt;p&gt;Spoiler: size matters, just not in the direction you'd guess every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Math You Can Do on a Napkin
&lt;/h2&gt;

&lt;p&gt;Claude doesn't see pixels. It sees patches. Per &lt;a href="https://platform.claude.com/docs/en/build-with-claude/vision" rel="noopener noreferrer"&gt;Anthropic's vision docs&lt;/a&gt;, each image is chopped into 28×28-pixel blocks ("visual tokens"), and the cost is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;visual_tokens&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Anthropic vision docs: ceil(w / 28) * ceil(h / 28)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;768&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1280&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1920&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1080&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2560&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1440&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{w}x{h}: {visual_tokens(w, h):,} tokens"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 1024x768: 1,036 tokens&lt;/span&gt;
&lt;span class="c1"&gt;# 1280x800: 1,334 tokens&lt;/span&gt;
&lt;span class="c1"&gt;# 1920x1080: 2,691 tokens&lt;/span&gt;
&lt;span class="c1"&gt;# 2560x1440: 4,784 tokens&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(In my runs, each screenshot actually came in 21 tokens over the formula, so 1,057 at 1024x768 and 4,805 at 2560x1440. Close enough for napkin work.)&lt;/p&gt;

&lt;p&gt;Two more things from the docs matter here. First, Claude 4.7 and later models sit on a high-resolution tier that tops out at 2,576 px on the long edge and 4,784 visual tokens per image. That means a 2560x1440 screen lands right at the ceiling. Second, the docs say screenshots you return to the computer-use and browser-use tools that exceed those limits are &lt;em&gt;rejected&lt;/em&gt; with a validation error rather than quietly downscaled. If your screen is bigger, resizing (and scaling the click coordinates back) is your job.&lt;/p&gt;

&lt;p&gt;So a 2560x1440 screenshot costs roughly four and a half times what a 1024x768 one does. Case closed? Not quite. The bill isn't per screenshot. It's per &lt;em&gt;task&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Experiment
&lt;/h2&gt;

&lt;p&gt;The setup, in brief:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; &lt;code&gt;claude-opus-5-5&lt;/code&gt; with Anthropic's computer-use toolset, run on Nov 16, 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser:&lt;/strong&gt; Chrome in kiosk mode at exactly 1024x768, 1280x800, 1920x1080, and 2560x1440, at a device pixel ratio of 1, with a fresh profile every run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context policy:&lt;/strong&gt; only the last 3 screenshots stay in history (older ones become a text placeholder), with prompt caching off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thinking:&lt;/strong&gt; "adaptive, low." It can't be turned off on this model, and the API rejects sampling settings like temperature, so I couldn't pin those either.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volume:&lt;/strong&gt; 10 runs per viewport per flow, with the hypotheses written down before the full runs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And two deliberately boring test flows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;TodoMVC&lt;/strong&gt; behind a demo login. Everything fits on screen at every size, so no scrolling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bootstrap 5.3.9's checkout example.&lt;/strong&gt; The form runs below the fold on smaller screens, so the agent has to scroll to finish it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every one of the 80 main runs succeeded, with zero retries or misclicks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flow 1: No Scrolling, No Mercy
&lt;/h2&gt;

&lt;p&gt;When the page fits on every screen, the agent does about the same work at every size, and you just pay for bigger pictures.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Viewport&lt;/th&gt;
&lt;th&gt;Tokens/screenshot&lt;/th&gt;
&lt;th&gt;Median input tokens&lt;/th&gt;
&lt;th&gt;Mean API calls&lt;/th&gt;
&lt;th&gt;Median cost/run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1024x768&lt;/td&gt;
&lt;td&gt;1,057&lt;/td&gt;
&lt;td&gt;37,701&lt;/td&gt;
&lt;td&gt;5.0&lt;/td&gt;
&lt;td&gt;$0.184&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1280x800&lt;/td&gt;
&lt;td&gt;1,355&lt;/td&gt;
&lt;td&gt;41,127&lt;/td&gt;
&lt;td&gt;4.8&lt;/td&gt;
&lt;td&gt;$0.199&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1920x1080&lt;/td&gt;
&lt;td&gt;2,712&lt;/td&gt;
&lt;td&gt;57,425&lt;/td&gt;
&lt;td&gt;5.0&lt;/td&gt;
&lt;td&gt;$0.271&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2560x1440&lt;/td&gt;
&lt;td&gt;4,805&lt;/td&gt;
&lt;td&gt;82,477&lt;/td&gt;
&lt;td&gt;5.0&lt;/td&gt;
&lt;td&gt;$0.382&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2560x1440 used 2.19x the input tokens of 1024x768&lt;/strong&gt;, or about 2.1x the cost per run. That's a 119% token premium for the privilege of a big monitor. Hot dang.&lt;/p&gt;

&lt;p&gt;One honest wrinkle: 1280x800 doesn't clearly cost more than 1024x768. Two of its ten runs batched the last steps into 4 calls instead of 5, and that saved more tokens than the bigger screenshots added. On a page like this, a little run-to-run behavior can outweigh one step up in screen size.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flow 2: Where the Big Screen Earns Its Keep
&lt;/h2&gt;

&lt;p&gt;On the checkout form, the smaller screens scrolled in every run. At 2560x1440, the whole form fit, and the agent never scrolled once.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Viewport&lt;/th&gt;
&lt;th&gt;Tokens/screenshot&lt;/th&gt;
&lt;th&gt;Median input tokens&lt;/th&gt;
&lt;th&gt;Mean API calls&lt;/th&gt;
&lt;th&gt;Median cost/run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1024x768*&lt;/td&gt;
&lt;td&gt;1,057&lt;/td&gt;
&lt;td&gt;20,395&lt;/td&gt;
&lt;td&gt;3.0&lt;/td&gt;
&lt;td&gt;$0.103&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1280x800*&lt;/td&gt;
&lt;td&gt;1,355&lt;/td&gt;
&lt;td&gt;22,183&lt;/td&gt;
&lt;td&gt;3.1&lt;/td&gt;
&lt;td&gt;$0.111&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1920x1080&lt;/td&gt;
&lt;td&gt;2,712&lt;/td&gt;
&lt;td&gt;30,361&lt;/td&gt;
&lt;td&gt;3.1&lt;/td&gt;
&lt;td&gt;$0.149&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2560x1440&lt;/td&gt;
&lt;td&gt;4,805&lt;/td&gt;
&lt;td&gt;23,693&lt;/td&gt;
&lt;td&gt;2.0&lt;/td&gt;
&lt;td&gt;$0.115&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;* Rerun with Chrome's payment-autofill popup turned off. More on that in a second.&lt;/p&gt;

&lt;p&gt;Here &lt;strong&gt;2560x1440 used only about 1.16x the input tokens of 1024x768&lt;/strong&gt; (about 1.12x the cost), and about 1.07x the tokens of 1280x800. Fewer steps shrank the big-screen token premium from roughly +119% to roughly +16%.&lt;/p&gt;

&lt;p&gt;Why? Every API call resends the conversation, which on this flow meant roughly 5,000 tokens of non-image context per call, plus the screenshots it's carrying. Skip a scroll, skip a screenshot, skip a call, and the savings add up fast. Meanwhile, 1920x1080 is the cautionary middle child: it needed about as many calls as 1280x800 &lt;em&gt;and&lt;/em&gt; paid for bigger screenshots, so it came out the most expensive of the bunch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Popup That Ate My Ratio
&lt;/h2&gt;

&lt;p&gt;I would be remiss if I didn't mention how this almost went sideways. In the first pass, the big screen came out &lt;em&gt;cheaper&lt;/em&gt; than 1024x768. Great headline. Also wrong.&lt;/p&gt;

&lt;p&gt;When a card field got focus, Chrome showed a payment-autofill popup. At 1024x768, the agent dismissed it with Escape 9 times across 10 runs, re-scrolled, and took another screenshot, which cost it an extra call almost every time (3.9 calls on average and a median of 28,850 tokens, versus 3.0 and 20,395 with the popup off). So I had the agents run a follow-up at 1024x768 and 1280x800 with the popup disabled, as a separate comparison after the main results. The extra call at 1024x768 vanished entirely.&lt;/p&gt;

&lt;p&gt;The lesson: one incidental browser popup moved the cost of a task by roughly 40%. Your test environment is part of your token bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fine Print (Trust, but Verify)
&lt;/h2&gt;

&lt;p&gt;This passes the smell test, but know the limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It's small.&lt;/strong&gt; Two simple pages, one model, one browser at DPR 1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The context policy matters.&lt;/strong&gt; I kept only the last 3 screenshots. Keep the full history and the big-screen penalty grows, because every old screenshot rides along on every call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The confidence intervals are tight because the runs were nearly deterministic&lt;/strong&gt; (all ten 2560 runs on the checkout form cost exactly 23,693 tokens). They measure run-to-run noise, not how well this generalizes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not everything was rerun.&lt;/strong&gt; 2560x1440 and 1920x1080 weren't rerun with the popup off. 2560 never pressed Escape, so I'm comfortable comparing it. But 1920 averaged about one Escape press per run, so its number may be slightly inflated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One scoring rule changed after the pilot&lt;/strong&gt;, before the full runs, and it's documented. The original rule would have flagged 4 successful runs as refusals just because of how the agent formatted its final message.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thinking was "adaptive, low," not off.&lt;/strong&gt; It showed up in 3 runs at 1920x1080, at 43 to 51 tokens each.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The absolute dollars are small:&lt;/strong&gt; about $0.10 to $0.38 per run, at list price ($4/$20 per million input/output tokens) including a 1.1x US-inference multiplier. The ratios are the story, and they compound at scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  So What Should You Do?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start at a modest viewport.&lt;/strong&gt; 1024x768 and 1280x800 were the two cheapest sizes in both flows here. Don't hand your agent a 4K canvas just because your own monitor is one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size the viewport to the task.&lt;/strong&gt; If a bigger screen removes scrolling on your key pages, it can nearly pay for itself. If it doesn't, you're just buying bigger pictures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Count calls, not pixels.&lt;/strong&gt; Cost tracked the number of steps more than resolution. Watch your loop's call count first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean up your test environment.&lt;/strong&gt; Kill autofill popups, cookie banners, and anything else that makes the agent stop and swat at the screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mind the ceiling.&lt;/strong&gt; At 2560 px wide you're at the high-resolution tier's limit. Anything bigger has to be resized in your code, or the API will reject it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trim screenshot history.&lt;/strong&gt; Every old screenshot you keep gets paid for again on every call.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Is monitor size a cost lever? Yes, just not a one-way one. Houston, we have a tradeoff.&lt;/p&gt;

&lt;p&gt;I'm curious what you've seen. If you're running computer-use agents for testing, what viewport did you land on, and did anything (popups, banners, infinite scroll) quietly blow up your token bill?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>testing</category>
      <category>automation</category>
      <category>agents</category>
    </item>
    <item>
      <title>Amazon CodeWhisperer Demo</title>
      <dc:creator>John Slowik</dc:creator>
      <pubDate>Mon, 15 May 2023 17:45:52 +0000</pubDate>
      <link>https://dev.to/jslow421/amazon-codewhisperer-demo-315b</link>
      <guid>https://dev.to/jslow421/amazon-codewhisperer-demo-315b</guid>
      <description>&lt;p&gt;At this point, even people living under rocks are probably aware that all things “AI” are the soup du jour of the tech world. The AI/ML revolution that’s been going on has produced some Large Language Models (LLMs), which have done some incredible things. Things like passing law school exams, completing coding interviews for six-figure jobs, and making Bing relevant, to name just a few. This is all exciting, but if you’re like me, you’re wondering what you should be doing with all this technology as a software engineer. To that end, we will take a trip to Amazon’s coding companion called Amazon &lt;a href="https://aws.amazon.com/codewhisperer/" rel="noopener noreferrer"&gt;CodeWhisperer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The first question we must answer often sounds like, “I know how to write code; why should I waste my time with an AI code companion?”. Let’s discuss a few significant benefits of using a tool like CodeWhisperer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enhanced Productivity
&lt;/h2&gt;

&lt;p&gt;CodeWhisperer has been trained on massive amounts of code. This means that when you're trying to solve a problem, it has likely seen it, or something very similar, before and has some ideas on how to help you. What this means is that, as an engineer, you can focus on novel and creative work, fostering innovation, instead of spending time on boilerplate tasks like Googling how to center a div for the three millionth time, ultimately enabling you to solve business problems more effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turbocharged Learning
&lt;/h2&gt;

&lt;p&gt;Maybe Android just added another official language, or you're a backend engineer with a friend with a "killer app" idea who just needs someone to "code some HTML" to make it a hit. Either way, it can be daunting to pick up a new technology while still maintaining your expected level of productivity. This is a sleeper candidate for the best feature of a tool like CodeWhisperer. The tool knows the language, and you know the problem domain. So go ahead and rewrite your Android app in Kotlin, or tell your friend you're in to help him build "Twitter, but for bipedal birds." CodeWhisperer has your back through the struggle of learning new syntax and keywords.&lt;/p&gt;

&lt;h2&gt;
  
  
  Time Savings
&lt;/h2&gt;

&lt;p&gt;Let's face it, there are many what I call "knucklehead" tasks that we have to deal with in our day-to-day work. You may be writing a DTO class, calling that repository method for the 9,000th time, writing a test case, or any other relatively simple task. This is the area where CodeWhisperer starts to shine through once you're comfortable, as the tool will chew through the annoying boilerplate almost without you having to think about it.&lt;/p&gt;

&lt;p&gt;Now I can hear you all screaming into your screens that excellent maxim from Mr. Torvalds, "Talk is cheap; show me the code.". I couldn't agree more. Let's make a quick application to demo some of the benefits. For the sake of brevity, we'll do a short Rust program that will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make a GET request to an API&lt;/li&gt;
&lt;li&gt;Retrieve the JSON&lt;/li&gt;
&lt;li&gt;Deserialize it to a struct&lt;/li&gt;
&lt;li&gt;Tell us how many humans are currently in outer space&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Feel free to follow along in your favorite language and IDE. Currently, CodeWhisperer has the strongest support for Python, Java, JavaScript, TypeScript, and C#. It also supports code generation for Go, Rust, PHP, Ruby, Kotlin, C, C++, Shell scripting, SQL, and Scala. As for IDEs, it supports VSCode and JetBrains at the time of writing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;You'll need a supported IDE (VSCode or JetBrains) and the AWS Toolkit extension (&lt;a href="https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/setup-toolkit.html" rel="noopener noreferrer"&gt;VSCode&lt;/a&gt;, &lt;a href="https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/setup-toolkit.html" rel="noopener noreferrer"&gt;JetBrains&lt;/a&gt;) to get started. Once you've set that up, we'll open it up by opening the extension menu (this will default to your left sidebar if you're on VSCode). Expand the CodeWhisperer menu, and give Start a click.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fesypg4o81x83n3cu8sxg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fesypg4o81x83n3cu8sxg.jpg" alt=" " width="760" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will open a window asking us how we want to log in. I’m going to use my AWS Builder ID. You can find information about the AWS Builder ID &lt;a href="https://docs.aws.amazon.com/signin/latest/userguide/sign-in-aws_builder_id.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fappbcm82hzeax9blvsvt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fappbcm82hzeax9blvsvt.jpg" alt=" " width="799" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll see a prompt to copy a code and log in or create your AWS Builder ID. You’re probably familiar with this authorization process already.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97jvjc2b6q6wu2aakd71.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97jvjc2b6q6wu2aakd71.jpg" alt=" " width="676" height="706"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the link has opened, you see a prompt to log in with your Builder ID or create one. Go ahead and go through whichever process is most appropriate for your situation. You’ll then need to allow the proper permissions for the Toolkit extension:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffg7btantkybw1odo40gd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffg7btantkybw1odo40gd.jpg" alt=" " width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-on Example
&lt;/h2&gt;

&lt;p&gt;Congratulations, you’ve now successfully configured CodeWhisperer—time to get coding. Feel free to use any language you like if you’re going to follow along. We will let CodeWhisperer write almost all the code, so choose whichever supported language you want to see. We will start when our application shows us our favorite “Hello, world!” output to stdout. If you would like a copy of the program I ended up with, you can find it here: &lt;a href="https://github.com/caylent/codewhisperer-demo" rel="noopener noreferrer"&gt;https://github.com/caylent/codewhisperer-demo&lt;/a&gt;. Unless I specifically mention manually modifying things, any code written outside of comments, or ending braces, is all generated by CodeWhisperer. The ending braces are essential to note because there are times when CodeWhisperer will continue generating lines until the cows come home, so you’ll want to use your judgment on when to cut it off.&lt;/p&gt;

&lt;p&gt;Alright. So let’s see what CodeWhisperer can do. The first thing we wanted to do was retrieve a JSON response from an API endpoint. Let’s write a comment indicating that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Send a GET request to https://api.spacebits.net/people and return the response JSON string&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we add a new line after our comment, CodeWhisperer makes itself known with a suggestion for what it thinks our function signature should look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nq0oax4yqlprhs2uii2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nq0oax4yqlprhs2uii2.jpg" alt=" " width="800" height="107"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This output looks ok, so we’ll hit TAB to insert this suggestion. Oh, look, we have more suggestions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkuaaidmhl8bd3ffyyd7h.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkuaaidmhl8bd3ffyyd7h.jpg" alt=" " width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s the URL we want to use. Excellent. Let’s accept the next few and see how CodeWhisperer intends to finish this out:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F37g52adnu74z03u27hmp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F37g52adnu74z03u27hmp.jpg" alt=" " width="800" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, this looks good at a glance, but as we know, we will only know if we test it. Let’s see what CodeWhisperer can do for us here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ma2hytkmade5nlixofv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ma2hytkmade5nlixofv.jpg" alt=" " width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This block above shows us that sometimes you might not get suggestions - you can force the suggestion to show up using opt + c (alt + c for my Windows friends), as I had to here, but once the cobwebs cleared, we get some valuable suggestions. Let’s see how it finishes out my test function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fcaylent.com%2Fwp-content%2Fuploads%2F2023%2F04%2FCodeWhisperer-Blog-Image-9-test-function.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fcaylent.com%2Fwp-content%2Fuploads%2F2023%2F04%2FCodeWhisperer-Blog-Image-9-test-function.gif" alt="example gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, that’s not bad, it’s certainly what I asked for, but it’s not what we intended to test. Let’s reword that comment to indicate we want to know that the string has some value rather than simply checking a type.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjgyxnzmb1f3ug2ruys5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjgyxnzmb1f3ug2ruys5.png" alt=" " width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We end up with this, and it looks much more promising. Let’s run it and see what happens. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5nh7wq4pwr29s6jyosd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5nh7wq4pwr29s6jyosd.jpg" alt=" " width="797" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hot dang, it passes. We have JSON. Next, we want to deserialize that JSON to a struct that matches. For our initial record, here’s a bit of the JSON structure we’re working with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzthn62at9pqpsjeqoqlk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzthn62at9pqpsjeqoqlk.png" alt=" " width="685" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Very simple but also niche. Let’s see what CodeWhisperer does with this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkumr80cbxleenth9qzk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkumr80cbxleenth9qzk.png" alt=" " width="799" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I cut this one off as it was more than happy to keep generating fields. This miss is understandable. The nuances of the specific data we’re using are a bit outside the scope of what I thought would work (and it’s very likely that since we’re using this data now, it’ll get anything related to it correct in the future). It did get a lot of the boilerplate stuff right, though, so simple enough to correct.&lt;/p&gt;

&lt;p&gt;Alright, I’ll fix that manually since I know the data. Then I’ll create the struct which will hold the collection of people in space. This time I’ll provide a bit more data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41zenzc51s7ea50vemce.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41zenzc51s7ea50vemce.png" alt=" " width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, this is cool. I did need to update the struct name manually, but the more information we provide, the more accurate the output will be. I’ll make a mental note of that.&lt;/p&gt;

&lt;p&gt;We have the JSON string and structs so now we are ready to deserialize things. Let’s write a function that will do that. CodeWhisperer is suggesting a comment now, too.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fikhynjm41ppnz92qnl0r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fikhynjm41ppnz92qnl0r.jpg" alt=" " width="798" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, this could be cool. Is it going to write everything for us? Let’s see. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3n4vfkrc48o6i19g47y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3n4vfkrc48o6i19g47y.png" alt=" " width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hmm. Well, this looks good. But, of course, you know what we need to do next. Write a test!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpy52xng64tlr9nsxsbte.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpy52xng64tlr9nsxsbte.png" alt=" " width="798" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CodeWhisperer nails it again. Doing a unit test for a function that depends on another function isn’t great, but can we marvel for a second at the fact that CodeWhisperer understood the context of how we were using the data? One thing that I did change was the assert statement. CodeWhisperer wanted a len() check, and Clippy (a Rust linter) prefers the is_empty() check, so we’re going with that. Otherwise, this is all CodeWhisperer’s code. The test passes; you can take my word for it this time.&lt;/p&gt;

&lt;p&gt;So at this point, we’ve retrieved the JSON and deserialized it into the structs. The last thing we want to do is have it output how many people are in space according to our data. &lt;/p&gt;

&lt;p&gt;CodeWhisperer has gotten us this far; let’s see if it can take us across the finish line.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj7aisghypknvb2c1zj5z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj7aisghypknvb2c1zj5z.png" alt=" " width="799" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything looks right. I know that, at this moment, there are ten people in space. Let’s run it and see what happens.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6aazjeojt9r3aeglkj5n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6aazjeojt9r3aeglkj5n.jpg" alt=" " width="797" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hah! Look at that. Let’s get greedy and ask it to print the names of each person, just for fun.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fls9bza3lqndrwluq6h25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fls9bza3lqndrwluq6h25.png" alt=" " width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once again, this passes the smell test. Let’s run it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Firovi1uw7unkhwdel2r6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Firovi1uw7unkhwdel2r6.jpg" alt=" " width="799" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check that out. Our application does everything we set out to do. There were some language-specific things in the background we needed to handle ourselves, and we fixed the items specific to our data, but outside of those, we wrote no code ourselves save for a few closing braces. That’s pretty wild.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Food For Thought
&lt;/h2&gt;

&lt;p&gt;I would be remiss if I didn’t mention that CodeWhisperer has some features we didn’t hit on during this brief demo that are worth discussing. First, I want to call out that CodeWhisprerer will let you know if you’re using code that closely resembles the open-source data that it was trained on (&lt;a href="https://aws.amazon.com/codewhisperer):" rel="noopener noreferrer"&gt;https://aws.amazon.com/codewhisperer):&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmeuuizk602365vvm46wm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmeuuizk602365vvm46wm.png" alt=" " width="800" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This great notification helps us avoid improperly copying entire blocks of code from other repositories. CodeWhisperer also has built-in security scanning to look for OWASP vulnerabilities in your code. We didn’t test this in our demo because of language support and the oversimple aim. If you’re using Python, Java, or JavaScript, you can use this feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We’ve done a simplistic example program to understand how to leverage CodeWhisperer in our workflows. We may be feeling pumped to jump right into our next app. Let’s take a second to talk about what we should consider with these tools.&lt;/p&gt;

&lt;p&gt;Most importantly, remember the &lt;a href="https://blog.cleancoder.com/uncle-bob/2015/11/18/TheProgrammersOath.html" rel="noopener noreferrer"&gt;Programmer’s Oath&lt;/a&gt;. Specifically, remember that you’re the engineer, and you are ultimately responsible for the code you push. Treat everything that CodeWhisperer writes as if it was written by someone you’ve never met. Trust, but verify. &lt;/p&gt;

&lt;p&gt;Additionally, always keep a weather eye out for potential security issues in code. One thing I’ve noticed, for example, is that some tools have a tendency to suggest very permissive policies in CDK projects. Be present when using these tools.&lt;/p&gt;

&lt;p&gt;Lastly we want to understand, at least at a high level, how tools like CodeWhisperer are trained. As we mentioned earlier CodeWhisperer has been trained on massive amounts of valid, working code in many different languages. The large mix of languages is a big benefit to us as users regardless of our personal language choice because a model trained on many languages actually outperforms a model trained on a single language. They can also potentially solve problems in languages that they weren’t specifically trained on thanks, in part, to &lt;a href="https://www.v7labs.com/blog/few-shot-learning-guide" rel="noopener noreferrer"&gt;few-shot (or even zero-shot) learning&lt;/a&gt;. If you’re interested in learning more about this, there’s an &lt;a href="https://arxiv.org/pdf/2210.14868.pdf" rel="noopener noreferrer"&gt;Amazon research paper&lt;/a&gt; that covers it. The training process is complex but learning more about it will better inform your expectations for how these tools will augment your coding practices. If you need a place to start on your journey to understand LLMs, check out &lt;a href="https://www.youtube.com/watch?v=lnA9DMvHtfI" rel="noopener noreferrer"&gt;this video&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With those caveats in mind, every software engineer, developer, architect, etc., should become familiar with AI tools such as Amazon CodeWhisperer. You will reap the benefits of enhanced productivity, turbocharged learning, and time savings. Just based on our simple example above, CodeWhisperer helped me complete the solution in about half the time it would normally take. For more complex examples I could see the potential for CodeWhisperer to reduce my time requirement by 70-80%. These are rough guesses at time saved, and your personal experience will very much depend on your knowledge of the language you’re using, as well as the specific problem you’re working on. In any case, with these productivity increases and time savings you will spend less time bogged down in the minute details of the code and more time providing value to your customers. Also, at least for the time being, CodeWhisperer is free to use. So go check it out, and let us know what you think!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
