<?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: Malisa</title>
    <description>The latest articles on DEV Community by Malisa (@middlebrooks314).</description>
    <link>https://dev.to/middlebrooks314</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F349321%2F0c91fe33-ca1f-4ebb-9314-50dac1ad4331.jpeg</url>
      <title>DEV Community: Malisa</title>
      <link>https://dev.to/middlebrooks314</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/middlebrooks314"/>
    <language>en</language>
    <item>
      <title>Claude Code Experiment: More Tokens Doesn't Mean Better Code</title>
      <dc:creator>Malisa</dc:creator>
      <pubDate>Wed, 14 Jan 2026 01:05:10 +0000</pubDate>
      <link>https://dev.to/middlebrooks314/claude-code-experiment-more-tokens-doesnt-mean-better-code-4l4l</link>
      <guid>https://dev.to/middlebrooks314/claude-code-experiment-more-tokens-doesnt-mean-better-code-4l4l</guid>
      <description>&lt;p&gt;As we kick off the new year, many companies are full speed ahead on leveraging AI tooling for productivity. In fact, some companies are looking at token usage as a way to assess AI adoption and productivity. As I began my own exploration of the Claude Code CLI, I couldn't help but wonder...are tokens the new lines of code; easy to count, impossible to trust?&lt;/p&gt;

&lt;p&gt;After taking Anthropic's "&lt;a href="https://anthropic.skilljar.com/claude-code-in-action" rel="noopener noreferrer"&gt;Claude Code in Action&lt;/a&gt;" course, I developed an experiment to test my new knowledge. My hypothesis was simple: &lt;em&gt;Claude Code features follow a diminishing returns curve. At some point, more tokens don't return better code.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Experiment&lt;/strong&gt;: Build a good ol' toy app, CLI Tic Tac Toe, four times, each using a different Claude Code technique. For each build, I logged token usage, created a QA agent to find bugs, and created a prompt to assess code quality. Then I used these data to create a metric: quality per token (QPT) and compared the QPT per technique to test my hypothesis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Four Techniques for building Tic Tac Toe:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Zero-shot: Raw prompt, no context&lt;/li&gt;
&lt;li&gt;Plan Mode: Explicit planning step before execution&lt;/li&gt;
&lt;li&gt;CLAUDE.md: Project context file, no planning&lt;/li&gt;
&lt;li&gt;CLAUDE.md + Plan Mode: Combined approach&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I used &lt;code&gt;claude --verbose&lt;/code&gt; to track token usage.&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%2Fx5oa2i4ejy3erpxyej1n.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%2Fx5oa2i4ejy3erpxyej1n.png" alt="claude --verbose CLI window image" width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: I used a fresh Claude session for each experiment. &lt;/p&gt;

&lt;p&gt;&lt;u&gt;Experiment 1&lt;/u&gt;: zero-shot prompt&lt;br&gt;
&lt;em&gt;&amp;gt; Can you create a CLI tic tac toe game using vanilla javascript with minimal dependencies. I would like it to be tested using jest and I would like it to be good quality code using classes.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Experiment 2&lt;/u&gt;: Plan Mode&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;--plan&lt;/span&gt; &amp;lt;Same Prompt from Experiment &lt;span class="c"&gt;#1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;Experiment 3&lt;/u&gt;: CLAUDE.md context file&lt;br&gt;
I created a file in the project directory like 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%2Fiia7gn11wlspgdjwv1mx.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%2Fiia7gn11wlspgdjwv1mx.png" alt="Example of Claude.md file in vim window" width="800" height="1115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and ran it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; create the game
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;Experiment 4&lt;/u&gt;: Same CLAUDE.md file from Experiment 3 + plan mode&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;--plan&lt;/span&gt; create the game
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Assessing Quality:&lt;/strong&gt; Role based prompt&lt;br&gt;
&lt;em&gt;&amp;gt; You are a senior engineer, can you assess this code for quality and give it a score code 1-5 on correctness, clarity, structure, maintainability, and extendability? Can you return an average of the scores?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Manual QA Agent&lt;/strong&gt;&lt;br&gt;
I created a &lt;a href="https://gist.github.com/Middlebrooks314/80fbdb26d16ee1c3bf8523fcdcec783a" rel="noopener noreferrer"&gt;test.js&lt;/a&gt; file and added context for the agent to play 10 TTT games and report any bugs found. All four iterations reported zero bugs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This experiment was designed very small for fast understanding using a well-known problem.&lt;/li&gt;
&lt;li&gt;This experiment used a lot of AI, but that was by design. I wanted to understand the tooling and token use, not how to build TTT... I've done it many times 😉. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;Tokens&lt;/th&gt;
&lt;th&gt;Quality&lt;/th&gt;
&lt;th&gt;QPT&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CLAUDE.md&lt;/td&gt;
&lt;td&gt;25,767&lt;/td&gt;
&lt;td&gt;4.9&lt;/td&gt;
&lt;td&gt;0.190&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLAUDE.md + --plan&lt;/td&gt;
&lt;td&gt;32,191&lt;/td&gt;
&lt;td&gt;4.6&lt;/td&gt;
&lt;td&gt;0.143&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zero-shot&lt;/td&gt;
&lt;td&gt;42,737&lt;/td&gt;
&lt;td&gt;4.8&lt;/td&gt;
&lt;td&gt;0.112&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;--plan&lt;/td&gt;
&lt;td&gt;52,910&lt;/td&gt;
&lt;td&gt;4.8&lt;/td&gt;
&lt;td&gt;0.091&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My assumption was partially true, the least expensive approach was also the best quality. As tokens increased, quality stayed flat or dropped. However, I didn't anticipate that the lowest token investment returned the highest quality. &lt;/p&gt;

&lt;p&gt;My colleague &lt;a href="https://www.linkedin.com/posts/rani-zilpelwar-85568767_aiengineering-fullstack-softwareconsulting-activity-7415811600651386880-YjCE?utm_source=share&amp;amp;utm_medium=member_desktop&amp;amp;rcm=ACoAACyvYh4B3qPXGesm88y2DmomkSIa9Xmly0Q" rel="noopener noreferrer"&gt;Rani&lt;/a&gt; recently wrote: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Context is Currency... In the world of AI, if you don't give the model the right background and constraints, it will confidently give you the wrong answer."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this case, less context meant lower quality for more tokens.&lt;/p&gt;

&lt;p&gt;I suspect the next wave after AI adoption will be understanding optimization and return on AI investment.&lt;/p&gt;

&lt;p&gt;Some of the earliest company wide AI adopters are already weighing in:&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%2F9ouuau525doauc9ystlp.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%2F9ouuau525doauc9ystlp.png" alt="Shopify CEO quote" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For AI models, context matters more than token use. I'm interested in digging into context engineering next, it seems that well structured context yields better results than simply feeding more tokens to the model. It really does seem like an art.&lt;/p&gt;

&lt;p&gt;🖼️ Cover Art: "Urania" depicted by Giacinto Gimignani, 1852&lt;/p&gt;

</description>
      <category>ai</category>
      <category>wecoded</category>
    </item>
    <item>
      <title>Duck Typing: What do ducks have to do with polymorphism?</title>
      <dc:creator>Malisa</dc:creator>
      <pubDate>Fri, 13 Mar 2020 13:39:51 +0000</pubDate>
      <link>https://dev.to/middlebrooks314/duck-typing-1gnn</link>
      <guid>https://dev.to/middlebrooks314/duck-typing-1gnn</guid>
      <description>&lt;p&gt;I have been reading &lt;em&gt;Practical Object-Oriented Design in Ruby&lt;/em&gt; aka &lt;a href="https://www.poodr.com/"&gt;&lt;em&gt;"POODR"&lt;/em&gt;&lt;/a&gt; by Sandi Metz. The book is coveted and frequently referenced as a beacon for establishing good software design habits. I just made it through chapter 5: "Reducing Costs with Duck Typing." &lt;em&gt;POODR&lt;/em&gt; is very detailed and helpful; however, as a beginner I needed more examples to grasp the concept. I went on a journey through the internet and found endless resources that said "If it talks like a duck..", you know the rest. Once I had an 'aha' moment the phrase made more sense, but before that moment I was like: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cMQe_cjc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/rp0g39w789nqe8uzge8p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cMQe_cjc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/rp0g39w789nqe8uzge8p.png" alt="Alt Text" width="582" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each resource was tangential to my goal of understanding duck typing, especially the hot debate between static and dynamic language users, y'all are serious. To get to the bottom of the duck typing concept, I have to start with some overarching concepts. &lt;/p&gt;

&lt;h3&gt;
  
  
  Dynamic vs. Static Languages
&lt;/h3&gt;

&lt;p&gt;Sandi Metz wrote "..languages use the term "type" to describe the category of the contents of a variable...knowledge of the category of contents of a variable or its type allows an application to have an expectation about how those contents will behave."&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Statically typed languages such as Java type-check before run time.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Basically static languages do some pre-flight checks before turning the human written code (source code) into code that the computer understands (machine code). This is advantageous because larger programs can run faster since all of the safety checks have been done. Another advantage is that visible type information can serve as documentation in the source code. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Dynamically typed languages such as Ruby type-check during runtime.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Dynamic languages are more spontaneous and take a &lt;em&gt;laissez faire&lt;/em&gt; approach by type-checking when the code is being executed. No compiling and a more lax syntax are some advantages to using a dynamic programming language. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Need more info?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you are still learning or need a refresher about the differences between dynamic and static languages here is an &lt;a href="https://hackernoon.com/i-finally-understand-static-vs-dynamic-typing-and-you-will-too-ad0c2bd0acc7"&gt;excellent&lt;/a&gt; resource.&lt;/p&gt;

&lt;h3&gt;
  
  
  Polymorphism
&lt;/h3&gt;

&lt;p&gt;Polymorphism translates to "many forms." In programming it is the ability of an object with different types to be handled by a common interface. &lt;/p&gt;

&lt;p&gt;The concept of polymorphism is not a novel concept in programming. The concepts are referenced as early as &lt;br&gt;
Carl Hewitt, Peter Bishop &amp;amp; Richard Steiger's proposal paper for &lt;a href="http://worrydream.com/refs/Hewitt-ActorModel.pdf"&gt;&lt;em&gt;A Universal Modular ACTOR Formalism for Artificial Intelligence&lt;/em&gt;&lt;/a&gt; in 1973.&lt;/p&gt;

&lt;p&gt;"One way to build an ACTOR machine is to put each actor on a chip and build a decoding network so that each actor chip can address all the others."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0VXk8sUj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mpmcuvujhneuw48dlbn2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0VXk8sUj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mpmcuvujhneuw48dlbn2.jpg" alt="Alt Text" width="400" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Static Polymorphism aka compile time polymorphism in languages such as Java have interfaces that have special contracts on how to interact with other classes. One implementation of polymorphism is called method overloading which allows a class to have more than one method with the same name. Another implementation is called method overriding, which allows a method declaration in a sub class contained inside a parent class. Methods in static languages only work correctly if they know the classes and types of their arguments. &lt;/p&gt;

&lt;p&gt;Dynamic Polymorphism aka runtime polymorphism in languages such as ruby refer to the ability of different objects to respond to the same message signature (method name and specified parameters). One example of dynamic polymorphism in an object oriented language is called "duck typing."&lt;/p&gt;

&lt;h3&gt;
  
  
  Duck Typing
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;What is it?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Duck typing is a programming method that allows any object to be passed into a method that has the method signatures expected in order to run. In short, it's not important what an object &lt;em&gt;is&lt;/em&gt;, rather what it &lt;em&gt;does&lt;/em&gt;. Objects of different types can respond to the same messages as long as they have the specific method behavior. It solves the certain design qualms such as large cases statements and dot methods such as .is_a or .respond_to? that can potentially cause software rot. Essentially allowing your code to rely on public interfaces rather than object types allows for flexibility and change over time. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;How does it work?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kyn1teUJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/casqhg6gmxobf6w3q4sq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kyn1teUJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/casqhg6gmxobf6w3q4sq.png" alt="Alt Text" width="880" height="710"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The implementation of the Cook class on the left is very rigid and resistant to change. The implementation on the right is an example of duck typing. The Cook class calls the method prepare_recipe and passes in the objects that allow each individual class to handle their own business logic. The classes don't have to keep track of another class's methods allowing for clean flexible interfaces. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;TDD Implementation&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XZjqAxUL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lgtwmvnvw5k84h8xh97h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XZjqAxUL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lgtwmvnvw5k84h8xh97h.png" alt="Alt Text" width="880" height="1062"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently, I used duck typing to build better Rspec tests by stubbing out a fake console. Instead of relying on user input in the console I added a Console class and a FakeConsole class. Each class contained the same methods signatures so they would behave the same when testing the generate_primes method.&lt;/p&gt;

&lt;p&gt;Alex Martelli summed it up well when he said "You don't really care for IS-A-- you really only care for Behaves-LIKE-A-- so, if you do test, this behavior is what you should be testing for."&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Conclusion&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you stuck with me up to this point, thanks for reading. I have more topics to explore to reach full enlightenment, such as other implementations of polymorphism and statically typed language interfaces. Feel free to leave feedback or helpful comments 🙃 Cheers&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Duck Typing Enlightenment&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bi5Xu7aH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/embmrh52glfcpzy5fojs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bi5Xu7aH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/embmrh52glfcpzy5fojs.jpg" alt="Alt Text" width="880" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>oop</category>
      <category>ducktyping</category>
    </item>
  </channel>
</rss>
