<?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: chuck zhang</title>
    <description>The latest articles on DEV Community by chuck zhang (@chuck_zhang_8fbea2c21c500).</description>
    <link>https://dev.to/chuck_zhang_8fbea2c21c500</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%2F4197115%2F8074fe46-89bb-4142-841e-faa3f1eede8c.png</url>
      <title>DEV Community: chuck zhang</title>
      <link>https://dev.to/chuck_zhang_8fbea2c21c500</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chuck_zhang_8fbea2c21c500"/>
    <language>en</language>
    <item>
      <title>I built a 25-question Seven Deadly Sins quiz. Here’s how it scores and shares results.</title>
      <dc:creator>chuck zhang</dc:creator>
      <pubDate>Fri, 20 Nov 2026 09:40:05 +0000</pubDate>
      <link>https://dev.to/chuck_zhang_8fbea2c21c500/i-built-a-25-question-seven-deadly-sins-quiz-heres-how-it-scores-and-shares-results-3ch</link>
      <guid>https://dev.to/chuck_zhang_8fbea2c21c500/i-built-a-25-question-seven-deadly-sins-quiz-heres-how-it-scores-and-shares-results-3ch</guid>
      <description>&lt;p&gt;A teammate gets praised for a project you helped finish. How would you react? That’s the kind of everyday situation behind my &lt;a href="https://7deadlysinstest.live/" rel="noopener noreferrer"&gt;7 Deadly Sins Test&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The site is a short self-reflection quiz inspired by the seven deadly sins. You answer 25 questions with four choices each and get a percentage breakdown for pride, greed, lust, envy, gluttony, wrath, and sloth. You can read a guide to your highest-scoring category or share it with a friend. There’s also an anime edition that maps the leading category to a character from &lt;em&gt;The Seven Deadly Sins&lt;/em&gt;. The quiz is free and requires no account.&lt;/p&gt;

&lt;p&gt;Keeping the full result out of the share link&lt;/p&gt;

&lt;p&gt;The quiz runs in the browser and saves your answers in &lt;code&gt;sessionStorage&lt;/code&gt;, so refreshing in the same tab brings you back to the question you were on.&lt;/p&gt;

&lt;p&gt;After the last answer, the quiz passes the seven raw scores to the result page in a URL fragment. The page moves the scores into &lt;code&gt;history.state&lt;/code&gt; and clears the fragment from the address bar. That lets the page restore the full breakdown if you refresh it.&lt;/p&gt;

&lt;p&gt;The copy button generates a new link with just the leading category and its percentage in the standard quiz. That’s enough for a friend to see what you got while keeping the full breakdown in your browser.&lt;/p&gt;

&lt;p&gt;When a tie looks like 30% vs. 29%&lt;/p&gt;

&lt;p&gt;Each answer adds one or two points to one category. To make the seven displayed percentages add up to exactly 100%, the quiz rounds them down first, then gives the leftover percentage points to the categories with the largest fractional remainders.&lt;/p&gt;

&lt;p&gt;For example, raw scores of &lt;code&gt;8, 8, 4, 3, 2, 1, 1&lt;/code&gt; display as &lt;code&gt;30%, 29%, 15%, 11%, 7%, 4%, 4%&lt;/code&gt;. Both categories with eight points still tie for first. The ranking uses raw scores, and the result page calls out the tie.&lt;/p&gt;

&lt;p&gt;How would you display those two bars so the tie is obvious at a glance?&lt;/p&gt;

</description>
      <category>mentalhealth</category>
      <category>bible</category>
      <category>gamedev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I Built a Retirement Calculator, and the Hardest Part Wasn't the Math</title>
      <dc:creator>chuck zhang</dc:creator>
      <pubDate>Wed, 21 Oct 2026 01:29:05 +0000</pubDate>
      <link>https://dev.to/chuck_zhang_8fbea2c21c500/i-built-a-retirement-calculator-and-the-hardest-part-wasnt-the-math-12oj</link>
      <guid>https://dev.to/chuck_zhang_8fbea2c21c500/i-built-a-retirement-calculator-and-the-hardest-part-wasnt-the-math-12oj</guid>
      <description>&lt;p&gt;I've been working on a side project called &lt;a href="https://freedomcalcs.com/" rel="noopener noreferrer"&gt;Freedom Calcs&lt;/a&gt;, a collection of calculators for exploring financial independence and retirement planning.&lt;/p&gt;

&lt;p&gt;It started with a question that sounds pretty simple:&lt;/p&gt;

&lt;p&gt;How much money do you need invested today so that compound growth can carry you toward retirement?&lt;/p&gt;

&lt;p&gt;That's the idea behind Coast FIRE.&lt;/p&gt;

&lt;p&gt;At first glance, building a calculator for this seems straightforward. Take a few inputs, apply a formula, and display the result.&lt;/p&gt;

&lt;p&gt;But while working on it, I realized something interesting: getting the math right is only part of building a trustworthy calculator.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Small assumptions can make a big difference&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One thing I had to pay attention to was the difference between nominal returns and real returns.&lt;/p&gt;

&lt;p&gt;For example, if you assume a 7% annual investment return and 3% inflation, the real return isn't exactly 4%.&lt;/p&gt;

&lt;p&gt;It's calculated as:&lt;/p&gt;

&lt;p&gt;(1 + 0.07) / (1 + 0.03) - 1&lt;/p&gt;

&lt;p&gt;That gives approximately 3.88%.&lt;/p&gt;

&lt;p&gt;The difference looks tiny, but when you're projecting results over 20 or 30 years, details like this start to matter.&lt;/p&gt;

&lt;p&gt;There's also the question of how monthly contributions are handled. Are they fixed nominal amounts, or do they increase with inflation?&lt;/p&gt;

&lt;p&gt;Both approaches can be modeled, but mixing them without explaining the assumptions creates misleading results.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Edge cases are more interesting than happy paths&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Another interesting part was thinking about unusual inputs.&lt;/p&gt;

&lt;p&gt;What happens when:&lt;/p&gt;

&lt;p&gt;The real return is negative?&lt;/p&gt;

&lt;p&gt;The expected return is exactly zero?&lt;/p&gt;

&lt;p&gt;Someone is already at their retirement target?&lt;/p&gt;

&lt;p&gt;Someone stops contributing entirely?&lt;/p&gt;

&lt;p&gt;The retirement age equals the current age?&lt;/p&gt;

&lt;p&gt;One detail I found especially interesting is that, under a constant-return Coast FIRE model, someone who is below their Coast target won't eventually reach it simply by waiting without contributing.&lt;/p&gt;

&lt;p&gt;Their investments grow, but the Coast threshold also changes as the time remaining until retirement gets shorter.&lt;/p&gt;

&lt;p&gt;This is the kind of behavior that's easy to overlook if you only test typical examples.&lt;/p&gt;

&lt;p&gt;For Freedom Calcs, I've tried to account for these cases and compare the calculations against independent mathematical checks.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A correct result can still be misleading&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This was probably the most important product-design consideration.&lt;/p&gt;

&lt;p&gt;A calculator might display something like:&lt;/p&gt;

&lt;p&gt;"You could reach your Coast FIRE target at age 45."&lt;/p&gt;

&lt;p&gt;But that result depends on assumptions about returns, inflation, contributions, and future spending.&lt;/p&gt;

&lt;p&gt;It's an estimate, not a prediction.&lt;/p&gt;

&lt;p&gt;I decided to make assumptions editable and include different contribution scenarios and return sensitivities, rather than presenting a single number as the answer.&lt;/p&gt;

&lt;p&gt;I also wanted the calculations to be inspectable, so the site includes methodology pages explaining the formulas and their limitations.&lt;/p&gt;

&lt;p&gt;The calculations run in the browser, without requiring users to create accounts or upload their financial information.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keeping things simple is surprisingly difficult&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The project has expanded beyond Coast FIRE to include Barista FIRE, Lean FIRE, Fat FIRE, and FIRE Number calculators.&lt;/p&gt;

&lt;p&gt;They cover related questions, but they don't all use the same financial model.&lt;/p&gt;

&lt;p&gt;One challenge is deciding how much explanation to show.&lt;/p&gt;

&lt;p&gt;Too little, and users may misunderstand the results.&lt;/p&gt;

&lt;p&gt;Too much, and a simple calculator starts feeling like a textbook.&lt;/p&gt;

&lt;p&gt;I'm still thinking about how to find the right balance.&lt;/p&gt;

&lt;p&gt;I'd love some feedback from other developers&lt;/p&gt;

&lt;p&gt;The project is available at Freedom Calcs, if anyone is curious about the implementation or wants to explore the calculators.&lt;/p&gt;

&lt;p&gt;But I'm especially interested in the engineering and UX side of this problem.&lt;/p&gt;

&lt;p&gt;How do you approach testing tools where the calculations might be technically correct, but the results could still be misunderstood?&lt;/p&gt;

&lt;p&gt;And how do you decide which assumptions should be visible to users without making the interface overwhelming?&lt;/p&gt;

&lt;p&gt;I'd love to hear how other developers approach this kind of problem.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
