<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged every</title>
<link>https://coderlegion.com/tag/every</link>
<description>Powered by Question2Answer</description>
<item>
<title>Non-Canonical URL in Sitemap: How to Fix It | FloxoLab</title>
<link>https://coderlegion.com/25665/non-canonical-url-in-sitemap-how-to-fix-it-floxolab</link>
<description>
&lt;p&gt;
        &lt;strong&gt;Direct answer:&lt;/strong&gt; when a sitemap contains a non-canonical URL, remove that entry and list the preferred canonical page instead. If the listed URL redirects, use the final destination. The replacement should return a direct &lt;code&gt;200&lt;/code&gt;, allow indexing, and declare itself canonical.
      &lt;/p&gt;
      &lt;p&gt;
        The warning means the sitemap presents one URL as preferred while a redirect, &lt;code&gt;rel=&quot;canonical&quot;&lt;/code&gt;, or Google's canonical selection points elsewhere. Do not replace every flagged URL blindly. Follow the redirect, inspect the declared canonical, and confirm that the destination is the page you actually want users to find. A bad destination should be corrected before it becomes the new sitemap entry. Cleaning the file does not guarantee crawling, indexing, or rankings.
      &lt;/p&gt;

      &lt;h2 id=&quot;use-this-action-table-for-each-sitemap-url&quot;&gt;Use this action table for each sitemap URL&lt;/h2&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;
            &lt;tr&gt;
              &lt;th&gt;Current result&lt;/th&gt;
              &lt;th&gt;What belongs in the sitemap&lt;/th&gt;
              &lt;th&gt;What else to fix&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;200&lt;/code&gt;, indexable, self-canonical&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;Keep the URL&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Confirm internal links use the same version&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;301&lt;/code&gt; or &lt;code&gt;308&lt;/code&gt; to a valid replacement&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;List the final destination&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Update internal links and remove redirect chains&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;302&lt;/code&gt; or &lt;code&gt;307&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;Usually keep the intended source out until the temporary state ends&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Confirm whether the move is truly temporary&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;200&lt;/code&gt;, canonical points elsewhere&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;List the chosen canonical&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Check that the pages are genuinely duplicate or very similar&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;200&lt;/code&gt; with &lt;code&gt;noindex&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;Remove it&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Keep or remove &lt;code&gt;noindex&lt;/code&gt; based on the page's purpose&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;404&lt;/code&gt; or &lt;code&gt;410&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;Remove it&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Redirect only if a relevant replacement exists&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;Redirect loop, long chain, or broken target&lt;/td&gt;
              &lt;td&gt;&lt;strong&gt;List nothing until repaired&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Point old URLs directly to one valid final page&lt;/td&gt;
            &lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;

      &lt;div class=&quot;article-callout&quot;&gt;
        &lt;p&gt;&lt;strong&gt;The clean rule:&lt;/strong&gt; one preferred content URL, one final &lt;code&gt;200&lt;/code&gt; response, one matching canonical, and one sitemap entry. Redirect sources and duplicate variants can remain useful routes for visitors, but they should not be presented as preferred sitemap URLs.&lt;/p&gt;
      &lt;/div&gt;

      &lt;h2 id=&quot;step-1-export-the-exact-sitemap-urls&quot;&gt;Step 1: export the exact sitemap URLs&lt;/h2&gt;
      &lt;p&gt;
        Open the sitemap in a browser or crawler and export every &lt;code&gt;&amp;lt;loc&amp;gt;&lt;/code&gt; value. If the site uses a sitemap index, collect the child sitemaps first and keep a column showing which file supplied each URL. That makes template-specific problems easier to find, such as all product URLs using HTTP or an old category sitemap still listing redirects.
      &lt;/p&gt;
      &lt;p&gt;
        Google requires fully qualified absolute URLs and attempts to crawl them exactly as listed. Treat these as different entries until the server proves otherwise:
      &lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;a href=&quot;http://example.com/service&quot; rel=&quot;nofollow&quot;&gt;http://example.com/service&lt;/a&gt;
&lt;a href=&quot;https://www.example.com/service/&quot; rel=&quot;nofollow&quot;&gt;https://www.example.com/service/&lt;/a&gt;
&lt;a href=&quot;https://example.com/service&quot; rel=&quot;nofollow&quot;&gt;https://example.com/service&lt;/a&gt;&lt;/pre&gt;
      &lt;p&gt;
        A browser may hide the redirect between them. Your audit should not. Record the listed URL, first response, each redirect hop, final URL, final status, robots state, declared canonical, and whether the page is intended for search.
      &lt;/p&gt;

      &lt;h2 id=&quot;step-2-crawl-the-list-and-follow-every-redirect&quot;&gt;Step 2: crawl the list and follow every redirect&lt;/h2&gt;
      &lt;p&gt;
        Use a crawler in list mode, a sitemap audit in your existing SEO tool, or command-line checks for a small file. &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/tools/screaming-frog-review&quot;&gt;Screaming Frog&lt;/a&gt;, for example, can crawl an uploaded URL list and export response codes, redirect chains, canonicals, and indexability in one table. The tool matters less than keeping the evidence together.
      &lt;/p&gt;
      &lt;p&gt;For one URL, these commands expose the first response and the final response after redirects:&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;curl -I &lt;a href=&quot;https://example.com/old-page&quot; rel=&quot;nofollow&quot;&gt;https://example.com/old-page&lt;/a&gt;
curl -I -L &lt;a href=&quot;https://example.com/old-page&quot; rel=&quot;nofollow&quot;&gt;https://example.com/old-page&lt;/a&gt;&lt;/pre&gt;
      &lt;p&gt;
        Do not stop when the final response says &lt;code&gt;200&lt;/code&gt;. A chain such as old URL to trailing-slash URL to HTTPS URL still makes crawlers request three addresses. Update the sitemap and internal links to the last address, then simplify the redirect so every obsolete version points directly to it.
      &lt;/p&gt;
      &lt;p&gt;
        Google documents permanent server-side redirects, including &lt;code&gt;301&lt;/code&gt; and &lt;code&gt;308&lt;/code&gt;, as strong signals that the destination should be canonical. Temporary redirects are handled differently because the source may remain the intended search URL. If a redirect has been &quot;temporary&quot; for months and the move is permanent, correct the response instead of working around it in the sitemap.
      &lt;/p&gt;
      &lt;p&gt;
        If the redirects belong to a redesign, CMS change, or domain move, use the full &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/site-migration-seo-checklist&quot;&gt;site migration SEO checklist&lt;/a&gt; to preserve the pre-launch crawl, map every old URL, test direct routes, and compare production after launch.
      &lt;/p&gt;

      &lt;h2 id=&quot;step-3-compare-the-final-url-with-the-declared-canonical&quot;&gt;Step 3: compare the final URL with the declared canonical&lt;/h2&gt;
      &lt;p&gt;
        On every final &lt;code&gt;200&lt;/code&gt; page, read the canonical from the rendered HTML head or HTTP header. The ordinary healthy case is an absolute self-referencing canonical that exactly matches the final URL. Check protocol, hostname, path capitalization, encoded characters, and trailing-slash convention.
      &lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&amp;lt;link rel=&quot;canonical&quot; href=&quot;&lt;a href=&quot;https://example.com/services/seo-audit&quot; rel=&quot;nofollow&quot;&gt;https://example.com/services/seo-audit&lt;/a&gt;&quot; /&amp;gt;&lt;/pre&gt;
      &lt;p&gt;
        If the page canonicalizes to another URL, inspect both pages. Keep the target in the sitemap only when it is a valid, indexable page and the two versions are duplicate or very similar. Google describes redirects and canonical annotations as strong signals, while sitemap inclusion is weaker. Stacking consistent signals helps. Listing both versions does not force Google to accept either one.
      &lt;/p&gt;
      &lt;p&gt;
        A canonical target that redirects, returns an error, is blocked, or has &lt;code&gt;noindex&lt;/code&gt; is not a clean destination. Repair that target or choose the actual final page before updating the sitemap. If Google selected a different canonical than you expected, use URL Inspection to compare the user-declared and Google-selected values. The &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/keyword-cannibalization-search-console&quot;&gt;keyword cannibalization guide&lt;/a&gt; covers the separate case where two distinct pages overlap in intent and should not be treated as simple duplicates.
      &lt;/p&gt;

      &lt;h2 id=&quot;step-4-decide-whether-each-url-should-exist-in-search&quot;&gt;Step 4: decide whether each URL should exist in search&lt;/h2&gt;
      &lt;p&gt;
        Sitemap cleanup is not only a status-code exercise. Ask whether each destination has a distinct job for users. Product variants, filters, print views, tracking URLs, internal search pages, thank-you pages, and staging paths may all return &lt;code&gt;200&lt;/code&gt; while being poor sitemap candidates.
      &lt;/p&gt;
      &lt;p&gt;For the wider store diagnosis around crawl paths, category and product templates, pagination, filters, stock states, and Product markup, continue with the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/ecommerce-seo-audit-checklist&quot;&gt;ecommerce SEO audit checklist&lt;/a&gt;.&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Keep it:&lt;/strong&gt; the page is useful, indexable, canonical, and meant to appear in search.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Consolidate it:&lt;/strong&gt; the URL duplicates another page that should collect the signals.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Noindex it:&lt;/strong&gt; users need the page, but it should not appear in search.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Remove it:&lt;/strong&gt; the page is obsolete and has no useful replacement.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;
        Do not redirect unrelated deleted URLs to the homepage merely to avoid a &lt;code&gt;404&lt;/code&gt;. Google warns against sending many old URLs to one irrelevant destination during site moves. A relevant replacement earns a permanent redirect. An intentionally removed page without a replacement can return &lt;code&gt;404&lt;/code&gt; or &lt;code&gt;410&lt;/code&gt; and stay out of the sitemap.
      &lt;/p&gt;

      &lt;h2 id=&quot;step-5-fix-the-sitemap-generator-not-just-the-xml-output&quot;&gt;Step 5: fix the sitemap generator, not just the XML output&lt;/h2&gt;
      &lt;p&gt;
        A manual deletion is temporary when the CMS, plugin, database query, or build script will add the URL back tomorrow. Find the source rule. Typical causes include published pages remaining in the sitemap after a slug change, a generator using database URLs before redirect normalization, duplicate language or protocol settings, and content types being included despite a sitewide &lt;code&gt;noindex&lt;/code&gt; template.
      &lt;/p&gt;
      &lt;p&gt;
        Prevent the same variants at publication time with a documented &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/seo-friendly-urls&quot;&gt;SEO-friendly URL policy for hierarchy, slugs, parameters, case, trailing slashes, and redirects&lt;/a&gt;. This sitemap workflow repairs the inventory after a problem exists; the URL policy controls what the generator is allowed to create.
      &lt;/p&gt;
      &lt;p&gt;A healthy entry is simple:&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&amp;lt;url&amp;gt;
  &amp;lt;loc&amp;gt;&lt;a href=&quot;https://example.com/services/seo-audit&quot; rel=&quot;nofollow&quot;&gt;https://example.com/services/seo-audit&lt;/a&gt;&amp;lt;/loc&amp;gt;
  &amp;lt;lastmod&amp;gt;2026-07-22&amp;lt;/lastmod&amp;gt;
&amp;lt;/url&amp;gt;&lt;/pre&gt;
      &lt;p&gt;
        Set &lt;code&gt;&amp;lt;lastmod&amp;gt;&lt;/code&gt; to the date of the last significant content change when your system can maintain it accurately. Do not refresh every date on every build. The sitemap should reflect the preferred URL inventory, not imitate constant freshness.
      &lt;/p&gt;
      &lt;p&gt;
        If you have several content types, generate them separately enough to diagnose. A sitemap index with pages, products, posts, and locations in distinct child files lets you isolate a bad rule and compare index coverage by sitemap without hand-editing thousands of rows.
      &lt;/p&gt;

      &lt;h2 id=&quot;step-6-update-internal-links-and-canonical-signals-together&quot;&gt;Step 6: update internal links and canonical signals together&lt;/h2&gt;
      &lt;p&gt;
        Removing a redirect from the sitemap while every navigation link still points to it solves only one symptom. Update menus, breadcrumbs, article links, hreflang references where applicable, and structured data to use the same preferred destination. The &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/technical-seo-fixes-agencies-wont-touch&quot;&gt;technical SEO fixes guide&lt;/a&gt; shows why stale links and bloated sitemap entries usually originate in shared templates.
      &lt;/p&gt;
      &lt;p&gt;
        Keep the old redirect for visitors and external links when it represents a real move. Sitemap cleanup does not mean deleting useful redirects from the server. It means the current site should stop discovering and advertising the obsolete address as if it were still the preferred page.
      &lt;/p&gt;

      &lt;h2 id=&quot;step-7-validate-the-new-file-before-submitting-it&quot;&gt;Step 7: validate the new file before submitting it&lt;/h2&gt;
      &lt;p&gt;
        Regenerate the sitemap, crawl it again as a fresh list, and fail the check if any listed page does not meet the intended rules. For a standard indexable-page sitemap, the practical acceptance test is:
      &lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;The sitemap itself returns &lt;code&gt;200&lt;/code&gt;, uses valid XML, and is accessible to Googlebot.&lt;/li&gt;
        &lt;li&gt;Every &lt;code&gt;&amp;lt;loc&amp;gt;&lt;/code&gt; is an absolute URL on the intended host and protocol.&lt;/li&gt;
        &lt;li&gt;Every listed page returns a direct &lt;code&gt;200&lt;/code&gt; without a redirect hop.&lt;/li&gt;
        &lt;li&gt;Every listed page allows indexing and names the same preferred canonical URL.&lt;/li&gt;
        &lt;li&gt;No duplicate, parameter, staging, deleted, or intentionally noindex URL remains.&lt;/li&gt;
        &lt;li&gt;Each &lt;code&gt;&amp;lt;lastmod&amp;gt;&lt;/code&gt;, when present, reflects a real significant change.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;
        Parse the XML as well as crawling the URLs. A technically perfect URL list still fails if special characters are not escaped, the namespace is wrong, or the file exceeds the protocol limits without being split.
      &lt;/p&gt;

      &lt;h2 id=&quot;step-8-use-search-console-for-the-right-checks&quot;&gt;Step 8: use Search Console for the right checks&lt;/h2&gt;
      &lt;p&gt;
        Submit or resubmit the sitemap in the matching Search Console property. The Sitemaps report shows whether Google fetched and parsed that file. It does not certify that every listed URL is canonical, crawled, or indexed. Google explicitly describes sitemap submission as a hint and says not every URL is guaranteed to be crawled or indexed.
      &lt;/p&gt;
      &lt;p&gt;
        Open the Page indexing report and filter by the specific submitted sitemap. Watch the categories that motivated the cleanup, such as &lt;strong&gt;Page with redirect&lt;/strong&gt;, &lt;strong&gt;Duplicate, Google chose different canonical than user&lt;/strong&gt;, &lt;strong&gt;Excluded by noindex&lt;/strong&gt;, or &lt;strong&gt;Not found (404)&lt;/strong&gt;. The report can lag behind the live site, so record the implementation date and read the report's last update before deciding the fix failed.
      &lt;/p&gt;
      &lt;p&gt;
        Use URL Inspection for a representative sample and every business-critical destination. The indexed result reflects Google's stored version. A live test checks the current fetch but does not test all canonical conditions or predict indexing. If a key page is still excluded, the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/crawled-currently-not-indexed&quot;&gt;Crawled - currently not indexed workflow&lt;/a&gt; provides the broader diagnosis.
      &lt;/p&gt;

      &lt;h2 id=&quot;what-success-looks-like&quot;&gt;What success looks like&lt;/h2&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;
            &lt;tr&gt;
              &lt;th&gt;Check&lt;/th&gt;
              &lt;th&gt;Immediate evidence&lt;/th&gt;
              &lt;th&gt;Later evidence&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;Sitemap file&lt;/td&gt;&lt;td&gt;Valid XML and direct &lt;code&gt;200&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Search Console can fetch and parse it&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;URL inventory&lt;/td&gt;&lt;td&gt;Only intended canonical pages remain&lt;/td&gt;&lt;td&gt;Submitted redirect and duplicate counts trend down&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Redirects&lt;/td&gt;&lt;td&gt;Old URLs reach one relevant destination&lt;/td&gt;&lt;td&gt;Internal crawl no longer discovers redirect sources&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Canonical signals&lt;/td&gt;&lt;td&gt;Final URL, canonical, links, and sitemap agree&lt;/td&gt;&lt;td&gt;URL Inspection increasingly shows the intended canonical&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Indexing&lt;/td&gt;&lt;td&gt;Pages are technically eligible&lt;/td&gt;&lt;td&gt;Critical canonical pages are indexed when Google selects them&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
      &lt;p&gt;
        A clean sitemap is not an indexing command and does not promise rankings. Its value is operational: it gives crawlers, tools, and your team one defensible inventory of the pages the site intends to surface. When that list stays clean automatically, future redirect and canonical mistakes become visible instead of accumulating silently.
      &lt;/p&gt;

      &lt;h2 id=&quot;practical-questions&quot;&gt;Practical questions&lt;/h2&gt;
      &lt;h3&gt;Will redirects in a sitemap hurt rankings?&lt;/h3&gt;
      &lt;p&gt;
        A few stale entries are not evidence of a ranking penalty. They are maintenance debt and conflicting discovery signals. Replace them with the final canonical URLs, then judge the affected pages by their actual crawl, canonical, indexing, and performance data.
      &lt;/p&gt;

      &lt;h3&gt;Should both a duplicate URL and its canonical be in the sitemap?&lt;/h3&gt;
      &lt;p&gt;
        No. Google recommends choosing the preferred URL and listing it instead of every URL that leads to the same content. Keep duplicate routes only when users or systems need them, and align their canonical or redirect behavior with the preferred page.
      &lt;/p&gt;

      &lt;h3&gt;Do I need to resubmit the sitemap after every change?&lt;/h3&gt;
      &lt;p&gt;
        Google periodically recrawls a successfully submitted sitemap. Search Console says resubmission can make sense after big changes, while ordinary updates can follow the regular schedule. Resubmitting does not guarantee immediate crawling or indexing.
      &lt;/p&gt;

      &lt;h2 id=&quot;sources-checked&quot;&gt;Sources checked&lt;/h2&gt;
      &lt;p&gt;Google's sitemap, redirect, canonical, and Search Console guidance was rechecked from official sources on August 21, 2026.&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: build and submit a sitemap&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: canonical signals and preferred sitemap URLs&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/301-redirects&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: permanent and temporary redirects&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: redirect mapping and relevant destinations during URL moves&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/webmasters/answer/7451001&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Console Help: Sitemaps report, resubmission, and parsing errors&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/webmasters/answer/7440203&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Console Help: Page indexing statuses and sitemap filters&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://support.google.com/webmasters/answer/9012289&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Console Help: URL Inspection limits and canonical fields&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;

      &amp;lt;nav class=&quot;article
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/25665/non-canonical-url-in-sitemap-how-to-fix-it-floxolab</guid>
<pubDate>Sun, 04 Oct 2026 15:50:00 +0000</pubDate>
</item>
<item>
<title>Programmatic SEO for Small Sites: Scale Only What Deserves a Page</title>
<link>https://coderlegion.com/25657/programmatic-seo-for-small-sites-scale-only-what-deserves-a-page</link>
<description>
&lt;p&gt;&lt;strong&gt;Direct answer:&lt;/strong&gt; a small site should use programmatic SEO only when every publishable row represents a distinct entity or situation, answers a repeatable user job, and contains enough verified data to make its page independently useful. A shared layout is fine. Shared substance with one token changed is not.&lt;/p&gt;
      &lt;p&gt;Programmatic SEO is a production method, not a promise to publish thousands of pages. Twelve pages generated from one verified dataset and one controlled template still use a programmatic system. The value comes from consistency and maintainability, not URL count.&lt;/p&gt;
      &lt;p&gt;This guide owns the dataset, template, eligibility, pilot, and lifecycle decision. The &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/topic-clusters-small-sites&quot;&gt;topic cluster guide&lt;/a&gt; handles ordinary editorial page jobs and link planning. The &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/update-merge-redirect-delete-old-seo-page&quot;&gt;old-page decision guide&lt;/a&gt; handles pages that have already lost their purpose or evidence.&lt;/p&gt;

      &lt;h2 id=&quot;programmatic-pages-need-three-independent-reasons-to-exist&quot;&gt;Programmatic pages need three independent reasons to exist&lt;/h2&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Reason&lt;/th&gt;&lt;th&gt;Pass condition&lt;/th&gt;&lt;th&gt;Failure signal&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;Distinct job&lt;/td&gt;&lt;td&gt;A person needs a result for this exact entity, location, compatibility pair, listing, or data slice&lt;/td&gt;&lt;td&gt;The page exists only because a keyword modifier exists&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Distinct evidence&lt;/td&gt;&lt;td&gt;The dataset supplies facts, availability, attributes, examples, or constraints specific to the row&lt;/td&gt;&lt;td&gt;The same paragraph works after replacing one noun&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Maintainable lifecycle&lt;/td&gt;&lt;td&gt;An owner can verify, update, pause, and retire the row when its source changes&lt;/td&gt;&lt;td&gt;No one knows when the data became wrong or what should happen next&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
      &lt;p&gt;If any reason is missing, keep the information inside a broader page, searchable directory, filter interface, or internal tool until stronger evidence exists.&lt;/p&gt;

      &lt;h2 id=&quot;good-and-bad-candidates-for-a-small-site&quot;&gt;Good and bad candidates for a small site&lt;/h2&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Candidate&lt;/th&gt;&lt;th&gt;Likely decision&lt;/th&gt;&lt;th&gt;Why&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;Branch pages with real addresses, hours, services, staff, access details, and local contacts&lt;/td&gt;&lt;td&gt;Possible&lt;/td&gt;&lt;td&gt;Each location can satisfy a distinct visit or contact job&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Software integration pages backed by tested capabilities, setup limits, and failure states&lt;/td&gt;&lt;td&gt;Possible&lt;/td&gt;&lt;td&gt;Each pairing can answer a distinct compatibility task&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Current listings, events, properties, or jobs with verified attributes and expiration rules&lt;/td&gt;&lt;td&gt;Possible&lt;/td&gt;&lt;td&gt;The entity and availability create a real page-level need&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Service plus every city where the business has no local proof or operational difference&lt;/td&gt;&lt;td&gt;Reject&lt;/td&gt;&lt;td&gt;Changing the city name does not create useful local evidence&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Every color, price, size, and sort combination from a filter interface&lt;/td&gt;&lt;td&gt;Usually reject&lt;/td&gt;&lt;td&gt;Combinations can create duplicate or near-infinite URL inventory&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;AI-written definitions for every keyword variation&lt;/td&gt;&lt;td&gt;Reject&lt;/td&gt;&lt;td&gt;The process scales wording rather than user value&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
      &lt;div class=&quot;article-callout&quot;&gt;&lt;p&gt;&lt;strong&gt;Automation is not the policy problem by itself.&lt;/strong&gt; Google's scaled content abuse policy focuses on many pages created primarily to manipulate rankings rather than help users. It applies whether the pages were produced by AI, conventional code, people, or a mixture.&lt;/p&gt;&lt;/div&gt;

      &lt;h2 id=&quot;step-1-define-one-repeatable-page-contract&quot;&gt;Step 1: define one repeatable page contract&lt;/h2&gt;
      &lt;p&gt;Write the job without mentioning SEO or a keyword:&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;This page helps [audience] complete [repeatable task]
for [specific entity or situation] using [row-level evidence].&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;A location page might help a prospective tenant evaluate one building using verified availability, amenities, access, policies, and contact information. The same layout can repeat, but the decision evidence must come from that building's record.&lt;/p&gt;
      &lt;p&gt;Record the boundary too:&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;This page will not exist when:
- the entity has no stable unique identity;
- required evidence is missing or expired;
- another page already answers the same job;
- the only difference is a keyword modifier;
- the row cannot be maintained after launch.&lt;/code&gt;&lt;/pre&gt;

      &lt;h2 id=&quot;step-2-create-a-data-contract-before-a-page-template&quot;&gt;Step 2: create a data contract before a page template&lt;/h2&gt;
      &lt;p&gt;The database decides whether the system can create useful pages. The visual template cannot repair a weak source. Define required fields, their owner, their source, and what missing data means.&lt;/p&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;th&gt;Required rule&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;entity_id&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Stable identity independent of title or URL&lt;/td&gt;&lt;td&gt;Unique and never reused&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;public_name&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Accurate label visible to users&lt;/td&gt;&lt;td&gt;Verified, not keyword-expanded&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;page_job&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Repeatable task this row satisfies&lt;/td&gt;&lt;td&gt;Must match the template contract&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;unique_evidence&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Facts or utility specific to the row&lt;/td&gt;&lt;td&gt;Minimum completeness threshold must pass&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;source&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Origin of every important fact&lt;/td&gt;&lt;td&gt;Named and reviewable&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;verified_at&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Freshness control&lt;/td&gt;&lt;td&gt;Within the defined review window&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;parent_id&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Directory or category that links to the page&lt;/td&gt;&lt;td&gt;Must resolve to a crawlable parent&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;publication_state&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Draft, eligible, published, paused, or retired&lt;/td&gt;&lt;td&gt;Only eligible rows can build indexable pages&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;&lt;code&gt;rejection_reason&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Explains why a row did not publish&lt;/td&gt;&lt;td&gt;Required for failed gates&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
      &lt;p&gt;A source timestamp alone does not prove accuracy. Assign a responsible owner and a review method. For third-party feeds, record what happens when the feed is late, incomplete, or contradictory. The safe default is to pause publication rather than fill gaps with generic copy.&lt;/p&gt;

      &lt;h2 id=&quot;step-3-separate-template-structure-from-page-value&quot;&gt;Step 3: separate template structure from page value&lt;/h2&gt;
      &lt;p&gt;The shared template should control consistent presentation:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;navigation, breadcrumbs, headings, and component order;&lt;/li&gt;
        &lt;li&gt;field labels and units;&lt;/li&gt;
        &lt;li&gt;disclosures, source notes, and update dates;&lt;/li&gt;
        &lt;li&gt;related-entity and parent links;&lt;/li&gt;
        &lt;li&gt;structured data that matches visible content;&lt;/li&gt;
        &lt;li&gt;empty-state and error behavior.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;The row must supply the useful substance:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;the direct answer for this entity or situation;&lt;/li&gt;
        &lt;li&gt;verified attributes, constraints, availability, or compatibility;&lt;/li&gt;
        &lt;li&gt;specific examples, media, calculations, or next actions where relevant;&lt;/li&gt;
        &lt;li&gt;known limitations and the last verification date;&lt;/li&gt;
        &lt;li&gt;a meaningful relationship to parent and related records.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;Do not create artificial uniqueness by asking AI to rewrite the same introduction several ways. AI can help normalize source records, flag missing fields, draft a summary from verified facts, or identify unusual rows for review. It should not invent local knowledge, product behavior, availability, or first-hand experience.&lt;/p&gt;

      &lt;h2 id=&quot;step-4-make-eligibility-a-hard-gate&quot;&gt;Step 4: make eligibility a hard gate&lt;/h2&gt;
      &lt;p&gt;Keep publication logic explicit and testable. A simplified rule might look like this:&lt;/p&gt;
      &lt;pre class=&quot;article-code&quot;&gt;&lt;code&gt;publishable =
  stable_unique_id
  AND distinct_user_job
  AND required_fields_complete
  AND source_is_current
  AND unique_evidence_threshold_passed
  AND no_existing_page_collision
  AND crawlable_parent_exists
  AND lifecycle_owner_assigned&lt;/code&gt;&lt;/pre&gt;
      &lt;p&gt;Failure should produce no indexable page. Do not build a thin URL and hope a canonical, &lt;code&gt;noindex&lt;/code&gt;, or future editorial pass will repair the inventory later. Store the rejected row and reason outside the public index until it qualifies.&lt;/p&gt;
      &lt;p&gt;Use a deterministic URL key. Titles and marketing labels change, so they make poor permanent identifiers. Prevent multiple parameter orders, capitalization variants, tracking parameters, and filter paths from creating alternate public versions. A self-referencing canonical supports a clean page, but canonicalization is not a substitute for controlling duplicate URL generation.&lt;/p&gt;

      &lt;h2 id=&quot;step-5-plan-discovery-without-creating-infinite-crawl-paths&quot;&gt;Step 5: plan discovery without creating infinite crawl paths&lt;/h2&gt;
      &lt;p&gt;Every eligible page needs a normal crawlable link from a useful parent, category, directory, or related page. Search boxes and client-side filter controls alone are weak discovery paths because crawlers do not generally submit searches. Link important destinations with normal &lt;code&gt;&amp;lt;a href&amp;gt;&lt;/code&gt; elements.&lt;/p&gt;
      &lt;p&gt;Decide which filters are navigation and which deserve indexable landing pages. Most sorting, session, and empty combinations do not. Google's faceted-navigation guidance warns that parameter combinations can create a near-infinite URL space. When a combination has no results and should not exist, return an appropriate &lt;code&gt;404&lt;/code&gt; response instead of redirecting every empty state to a generic page.&lt;/p&gt;
      &lt;p&gt;Include only intended canonical pages in the XML sitemap. A sitemap helps discovery but does not guarantee crawling or indexing. It also does not make an orphaned or low-value page useful.&lt;/p&gt;

      &lt;h2 id=&quot;do-not-make-crawl-budget-the-small-site-business-case&quot;&gt;Do not make crawl budget the small-site business case&lt;/h2&gt;
      &lt;p&gt;Google's current crawl-budget guide is aimed primarily at sites with roughly one million or more changing pages, sites with ten thousand or more pages changing daily, or sites with a large share of discovered-but-not-indexed URLs. Those are rough classifications, not thresholds to chase.&lt;/p&gt;
      &lt;p&gt;For a small programmatic project, the immediate risks are usually simpler: weak evidence, duplicate jobs, broken data, orphan pages, and an inventory no one maintains. Keep the sitemap accurate, review the Page Indexing report, and control unnecessary URLs. Do not justify a bad template with an advanced crawl-budget story.&lt;/p&gt;

      &lt;h2 id=&quot;step-6-build-a-deliberately-small-pilot&quot;&gt;Step 6: build a deliberately small pilot&lt;/h2&gt;
      &lt;p&gt;Generate a sample that exposes variation instead of selecting only the best records:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;one complete, high-confidence row;&lt;/li&gt;
        &lt;li&gt;one row near the minimum evidence threshold;&lt;/li&gt;
        &lt;li&gt;one record with optional fields missing;&lt;/li&gt;
        &lt;li&gt;one entity close to an existing page;&lt;/li&gt;
        &lt;li&gt;one expired or paused state;&lt;/li&gt;
        &lt;li&gt;one zero-result or invalid combination.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;For many small teams, a first public cohort of roughly 10 to 25 pages is manageable enough for manual review. That is an operational suggestion, not a Google rule. The right number is the number your owner can inspect, support, and reverse safely.&lt;/p&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Review layer&lt;/th&gt;&lt;th&gt;What to inspect&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;Rendered page&lt;/td&gt;&lt;td&gt;Direct answer, headings, missing fields, source note, mobile layout, images, and next action&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;HTML and status&lt;/td&gt;&lt;td&gt;200 response, unique title and H1, canonical, robots state, crawlable links, and structured data parity&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Dataset&lt;/td&gt;&lt;td&gt;Stable ID, source accuracy, duplicate records, dates, and rejection logic&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Architecture&lt;/td&gt;&lt;td&gt;Parent path, related links, closest existing page, and collision boundary&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Lifecycle&lt;/td&gt;&lt;td&gt;Update, pause, expiration, removal, redirect, and owner behavior&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;

      &lt;h2 id=&quot;step-7-measure-the-pilot-before-expanding&quot;&gt;Step 7: measure the pilot before expanding&lt;/h2&gt;
      &lt;p&gt;Track the production system and the search outcome separately:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;source rows, eligible rows, rejected rows, and rejection reasons;&lt;/li&gt;
        &lt;li&gt;published pages, build errors, stale records, and manual corrections;&lt;/li&gt;
        &lt;li&gt;submitted canonical URLs and sampled Google-selected canonicals;&lt;/li&gt;
        &lt;li&gt;indexed pages and Page Indexing classifications;&lt;/li&gt;
        &lt;li&gt;queries and landing pages that match the intended job;&lt;/li&gt;
        &lt;li&gt;qualified actions such as contact, booking, application, or product use;&lt;/li&gt;
        &lt;li&gt;maintenance time and error rate per update cycle.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;Expand only when the sample answers its intended job, the data stays accurate, pages remain distinct, and the team can maintain the lifecycle. Impressions on unrelated queries, widespread duplicate canonical selection, repeated manual corrections, or no useful action are reasons to stop and repair the model.&lt;/p&gt;

      &lt;h2 id=&quot;retirement-is-part-of-the-template&quot;&gt;Retirement is part of the template&lt;/h2&gt;
      &lt;p&gt;Define the exit before launch:&lt;/p&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;
        &lt;table class=&quot;article-table&quot;&gt;
          &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Change&lt;/th&gt;&lt;th&gt;Typical response&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
            &lt;tr&gt;&lt;td&gt;Temporary data delay&lt;/td&gt;&lt;td&gt;Keep the last verified page only if it remains accurate, label the date, and pause new generation&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Required evidence disappears&lt;/td&gt;&lt;td&gt;Remove index eligibility until the record qualifies again&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Entity permanently moves to an equivalent replacement&lt;/td&gt;&lt;td&gt;Use a direct permanent redirect when the replacement satisfies the same job&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Entity ends with no relevant replacement&lt;/td&gt;&lt;td&gt;Return 404 or 410 and remove links and sitemap entry&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Two records are actually one entity&lt;/td&gt;&lt;td&gt;Consolidate the data and URL signals into one maintained page&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Users need the page but search does not&lt;/td&gt;&lt;td&gt;Keep the operational page and consider a crawlable &lt;code&gt;noindex&lt;/code&gt; state&lt;/td&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;

      &lt;h2 id=&quot;common-failure-modes&quot;&gt;Common failure modes&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Starting with a keyword matrix.&lt;/strong&gt; Multiplying cities by services creates URLs before proving distinct needs or evidence.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Letting the template hide missing data.&lt;/strong&gt; Generic paragraphs make an incomplete row look finished.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Using AI as the source.&lt;/strong&gt; Generated prose cannot verify availability, compatibility, location details, or first-hand claims.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Publishing rejected rows with noindex.&lt;/strong&gt; This leaves avoidable inventory and maintenance debt in production.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Indexing every filter.&lt;/strong&gt; Valid user controls do not automatically deserve search landing pages.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Relying on the sitemap for architecture.&lt;/strong&gt; Pages still need meaningful crawlable relationships.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Launching the whole dataset.&lt;/strong&gt; A template error becomes a sitewide error immediately.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Having no retirement state.&lt;/strong&gt; Listings, jobs, properties, offers, and integrations change.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Counting URLs as success.&lt;/strong&gt; The goal is useful outcomes from accurate pages, not inventory growth.&lt;/li&gt;
      &lt;/ul&gt;

      &lt;h2 id=&quot;go-or-no-go-checklist&quot;&gt;Go or no-go checklist&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;One repeatable user job exists independently of keyword variations.&lt;/li&gt;
        &lt;li&gt;Every entity has a stable unique ID and named data source.&lt;/li&gt;
        &lt;li&gt;Required row-level evidence is defined and testable.&lt;/li&gt;
        &lt;li&gt;Missing or stale data blocks publication by default.&lt;/li&gt;
        &lt;li&gt;The template presents verified differences instead of rewritten boilerplate.&lt;/li&gt;
        &lt;li&gt;Every eligible page has a useful crawlable parent and clean canonical URL.&lt;/li&gt;
        &lt;li&gt;Filter combinations and alternate URL forms cannot explode the public inventory.&lt;/li&gt;
        &lt;li&gt;A heterogeneous pilot can be manually inspected and reversed.&lt;/li&gt;
        &lt;li&gt;Search outcomes, business actions, data errors, and maintenance cost will be measured.&lt;/li&gt;
        &lt;li&gt;Pause, merge, redirect, noindex, and removal states have owners and rules.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;If those conditions feel stricter than writing pages manually, the system is working. Programmatic SEO earns its place when structured evidence makes repeated usefulness cheaper and more reliable. It should never make weak pages cheaper to publish.&lt;/p&gt;

      &lt;h2&gt;Sources checked&lt;/h2&gt;
      &lt;p&gt;Search policy, crawling, indexing, and structured-data guidance were verified from official Google documentation on August 2, 2026.&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/essentials/spam-policies#scaled-content&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: scaled content abuse policy&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/fundamentals/creating-helpful-content&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: helpful, reliable, people-first content&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/fundamentals/using-gen-ai-content&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: generative AI content guidance&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/crawling/docs/crawl-budget&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google crawling documentation: crawl budget scope and practices&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&amp;lt;a href=&quot;&lt;a href=&quot;https://developers.goo&quot; rel=&quot;nofollow&quot;&gt;https://developers.goo&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/25657/programmatic-seo-for-small-sites-scale-only-what-deserves-a-page</guid>
<pubDate>Sat, 26 Sep 2026 15:50:00 +0000</pubDate>
</item>
<item>
<title>SEO-Friendly Web Design Checklist: Architecture Before Aesthetics</title>
<link>https://coderlegion.com/25630/seo-friendly-web-design-checklist-architecture-before-aesthetics</link>
<description>
&lt;p class=&quot;article-intro&quot;&gt;&lt;strong&gt;Direct answer:&lt;/strong&gt; An SEO-friendly design starts with an agreed page inventory, crawlable navigation, stable URL and template rules, equivalent mobile content, responsive media, relevant structured data, and a production-like validation gate. Visual design then works inside that system. It cannot repair important pages that do not exist, links that crawlers cannot follow, or templates that publish the wrong metadata at scale.&lt;/p&gt;
      &lt;div class=&quot;article-callout&quot;&gt;&lt;p&gt;&lt;strong&gt;Narrow job:&lt;/strong&gt; This checklist defines the pre-launch design and development contract. Use the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/static-vs-dynamic-websites-seo&quot;&gt;static versus dynamic website guide&lt;/a&gt; to choose the publishing architecture. Use the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/site-migration-seo-checklist&quot;&gt;site migration checklist&lt;/a&gt; when an existing site, domain, or URL set is being replaced.&lt;/p&gt;&lt;/div&gt;

      &lt;h2 id=&quot;map-page-jobs-before-wireframes&quot;&gt;1. Map page jobs before drawing wireframes&lt;/h2&gt;
      &lt;p&gt;Start with the questions customers need answered and the actions the business needs them to complete. Convert those jobs into a page inventory before deciding how the homepage looks. A visual sitemap full of generic labels such as Services, Solutions, and Resources is not enough. Each planned URL needs a distinct purpose, owner, content requirement, and next route.&lt;/p&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;&lt;table class=&quot;article-table article-table-wide&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Design input&lt;/th&gt;&lt;th&gt;Decision to record&lt;/th&gt;&lt;th&gt;Acceptance evidence&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;
        &lt;tr&gt;&lt;td&gt;Page inventory&lt;/td&gt;&lt;td&gt;Which search or customer job each page owns&lt;/td&gt;&lt;td&gt;No two pages compete for the same primary task without a reason&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Hierarchy&lt;/td&gt;&lt;td&gt;How pages group into sections and parent routes&lt;/td&gt;&lt;td&gt;A new visitor can identify location and next action from any landing page&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Template set&lt;/td&gt;&lt;td&gt;Which page types share fields and behavior&lt;/td&gt;&lt;td&gt;One representative instance exists for every important template&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Publishing ownership&lt;/td&gt;&lt;td&gt;Who can create, update, retire, and validate each type&lt;/td&gt;&lt;td&gt;The real owner can complete the workflow without bypassing controls&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Launch gate&lt;/td&gt;&lt;td&gt;What must pass before the production switch&lt;/td&gt;&lt;td&gt;Status, rendering, links, metadata, schema, mobile, and performance are recorded&lt;/td&gt;&lt;/tr&gt;
      &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
      &lt;p&gt;Google's &lt;a href=&quot;https://developers.google.com/search/docs/fundamentals/seo-starter-guide&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;SEO Starter Guide&lt;/a&gt; recommends organizing a site logically so users and search engines can understand how pages relate. The practical deliverable is not a promise that every page will rank. It is a maintained map showing why every indexable page exists and how it connects to the rest of the site.&lt;/p&gt;

      &lt;h2 id=&quot;turn-hierarchy-into-crawlable-navigation&quot;&gt;2. Turn the hierarchy into crawlable navigation&lt;/h2&gt;
      &lt;p&gt;Design the global navigation, section navigation, breadcrumbs, contextual links, cards, and footer as one discovery system. Every important page should have at least one durable internal route. High-value pages normally need several routes that match real customer journeys, not one hidden link in an XML sitemap.&lt;/p&gt;
      &lt;p&gt;Google generally discovers links when they are ordinary &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; elements with an &lt;code&gt;href&lt;/code&gt;. A styled button, router event, or clickable card without a resolvable link may work for a person and still be unreliable for crawling. The official &lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/links-crawlable&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;crawlable links guidance&lt;/a&gt; also recommends concise, descriptive anchor text that tells people and Google what the destination contains.&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;Use real links for destinations and buttons for actions.&lt;/li&gt;
        &lt;li&gt;Keep the primary navigation usable with a keyboard and without precise pointer movement.&lt;/li&gt;
        &lt;li&gt;Do not remove essential section links from mobile merely to make the header smaller.&lt;/li&gt;
        &lt;li&gt;Show the selected navigation state without making it the only explanation of page location.&lt;/li&gt;
        &lt;li&gt;Test orphan risk from every template, including campaigns and dynamically created pages.&lt;/li&gt;
      &lt;/ul&gt;

      &lt;h2 id=&quot;define-url-and-page-state-rules&quot;&gt;3. Define URL and page-state rules&lt;/h2&gt;
      &lt;p&gt;Approve URL patterns before content entry and interface development create dozens of exceptions. Decide how service, category, product, article, location, filter, pagination, search, and campaign states behave. Record the final status, indexability, canonical target, sitemap inclusion, and internal-link policy for each family.&lt;/p&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;&lt;table class=&quot;article-table&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;State&lt;/th&gt;&lt;th&gt;Required design rule&lt;/th&gt;&lt;th&gt;Failure to prevent&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;
        &lt;tr&gt;&lt;td&gt;Canonical page&lt;/td&gt;&lt;td&gt;One stable, descriptive URL with a self-canonical&lt;/td&gt;&lt;td&gt;Multiple routes competing for the same content&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Moved page&lt;/td&gt;&lt;td&gt;Direct permanent redirect to the closest valid replacement&lt;/td&gt;&lt;td&gt;Redirect chains or blanket homepage redirects&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Missing page&lt;/td&gt;&lt;td&gt;Useful error design with the correct HTTP status&lt;/td&gt;&lt;td&gt;A soft 404 that looks live but has no main content&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Filtered or sorted state&lt;/td&gt;&lt;td&gt;Explicit crawl and index policy by parameter family&lt;/td&gt;&lt;td&gt;An uncontrolled URL space created by interface controls&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Preview or staging page&lt;/td&gt;&lt;td&gt;Access control and a production removal check&lt;/td&gt;&lt;td&gt;Test URLs indexed or the live site left blocked&lt;/td&gt;&lt;/tr&gt;
      &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
      &lt;p&gt;The &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/seo-friendly-urls&quot;&gt;SEO-friendly URL guide&lt;/a&gt; covers normalization and later URL changes in detail. During design, the important decision is which states are real destinations and which are interface states. Do not let the router make that policy accidentally.&lt;/p&gt;

      &lt;h2 id=&quot;build-a-template-seo-contract&quot;&gt;4. Build a template SEO contract&lt;/h2&gt;
      &lt;p&gt;Wireframes should describe required content and metadata, not only rectangles. For every template, define where the title, H1, summary, main content, author or business evidence, media, internal links, CTA, canonical, robots directive, social image, and structured data come from. Mark which fields are required, optional, generated, and editable.&lt;/p&gt;
      &lt;p&gt;A useful acceptance sample includes normal, long, missing, duplicate, and retired content. Test a long service title, a product without a secondary image, an article with a table, a category with no current inventory, and an unpublished record. This exposes brittle layouts and metadata fallbacks before they affect hundreds of URLs.&lt;/p&gt;
      &lt;div class=&quot;article-callout&quot;&gt;
        &lt;p&gt;&lt;strong&gt;Example: service template contract&lt;/strong&gt;&lt;/p&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;strong&gt;Title:&lt;/strong&gt; editable and required.&lt;/li&gt;
          &lt;li&gt;&lt;strong&gt;H1:&lt;/strong&gt; editable, required, and limited to one per page.&lt;/li&gt;
          &lt;li&gt;&lt;strong&gt;Canonical:&lt;/strong&gt; generated from the approved URL.&lt;/li&gt;
          &lt;li&gt;&lt;strong&gt;Structured data:&lt;/strong&gt; BreadcrumbList.&lt;/li&gt;
          &lt;li&gt;&lt;strong&gt;Featured image:&lt;/strong&gt; required, 1600 &amp;times; 900 maximum dimensions, and no larger than 200 KB.&lt;/li&gt;
          &lt;li&gt;&lt;strong&gt;Missing service:&lt;/strong&gt; return 404.&lt;/li&gt;
          &lt;li&gt;&lt;strong&gt;Retired service:&lt;/strong&gt; redirect directly with 301 to the closest relevant replacement.&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;article-callout&quot;&gt;&lt;p&gt;&lt;strong&gt;Template rule:&lt;/strong&gt; If the same mistake can appear on every page of a type, the fix belongs in the template, schema, component, or publishing validation. The &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/technical-seo-fixes-agencies-wont-touch&quot;&gt;template-level technical SEO guide&lt;/a&gt; shows why page-by-page cleanup does not hold.&lt;/p&gt;&lt;/div&gt;

      &lt;h2 id=&quot;protect-mobile-content-and-accessibility&quot;&gt;5. Protect mobile content and accessibility&lt;/h2&gt;
      &lt;p&gt;Responsive design may rearrange a page, but it should not remove the information that gives the page its purpose. Google's &lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/mobile/mobile-sites-mobile-first-indexing&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;mobile-first indexing guidance&lt;/a&gt; says primary content, meaningful headings, metadata, structured data, and important images should remain equivalent across mobile and desktop. Content can move into accessible accordions or tabs when space is tight. It should not depend on a swipe, click, or typing action before it exists for crawling.&lt;/p&gt;
      &lt;p&gt;Accessibility is a design requirement, not a final plugin. W3C organizes WCAG 2.2 around content being perceivable, operable, understandable, and robust. Apply that to navigation order, landmarks, heading structure, color contrast, focus visibility, labels, errors, touch targets, reduced motion, and keyboard operation. Automated checks help, but a person still needs to complete the main tasks with a keyboard and screen-size changes.&lt;/p&gt;
      &lt;p&gt;Use the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/mobile-seo-checklist&quot;&gt;mobile SEO checklist&lt;/a&gt; for device-level rendering and task validation after the responsive templates exist.&lt;/p&gt;

      &lt;h2 id=&quot;set-media-and-performance-budgets&quot;&gt;6. Set media and performance budgets before visual sign-off&lt;/h2&gt;
      &lt;p&gt;A fast mockup is not evidence that the production page will be fast. Test the real font files, hero media, navigation, consent controls, forms, embeds, third-party scripts, and content length. Define budgets by template so a later design change has a measurable trade-off instead of a vague instruction to optimize it.&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;Reserve image and embed dimensions to prevent layout shifts.&lt;/li&gt;
        &lt;li&gt;Provide responsive image candidates and realistic &lt;code&gt;sizes&lt;/code&gt;.&lt;/li&gt;
        &lt;li&gt;Do not lazy-load the likely LCP image or critical above-the-fold content.&lt;/li&gt;
        &lt;li&gt;Load nonessential scripts only where the page job requires them.&lt;/li&gt;
        &lt;li&gt;Test slow phones, constrained networks, long content, and validation errors.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;The current Core Web Vitals targets are LCP within 2.5 seconds, INP at 200 milliseconds or less, and CLS at 0.1 or less, evaluated at the 75th percentile separately for mobile and desktop. These are field targets, not a guarantee that a page will rank. Use the &lt;a href=&quot;https://web.dev/articles/vitals&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;web.dev definitions&lt;/a&gt; as the source and the &lt;a rel=&quot;nofollow&quot; href=&quot;https://floxolab.com/seo/guides/how-to-fix-core-web-vitals&quot;&gt;Core Web Vitals diagnosis&lt;/a&gt; when a representative template misses them.&lt;/p&gt;

      &lt;h2 id=&quot;map-structured-data-to-visible-content&quot;&gt;7. Map structured data to visible content&lt;/h2&gt;
      &lt;p&gt;Choose structured data from the page's actual job, not from a list of schema types a plugin can emit. Map each supported template to the relevant Google feature documentation, required properties, visible source fields, canonical URL, image ownership, and validation test. Keep the markup synchronized with the page as content changes.&lt;/p&gt;
      &lt;p&gt;Google's &lt;a href=&quot;https://developers.google.com/search/docs/appearance/structured-data/sd-policies&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;structured data guidelines&lt;/a&gt; require markup to represent the main visible content and warn against hidden, irrelevant, or misleading data. Valid markup only creates eligibility. It does not guarantee a rich result.&lt;/p&gt;
      &lt;div class=&quot;article-table-wrap&quot;&gt;&lt;table class=&quot;article-table&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Template&lt;/th&gt;&lt;th&gt;Possible structured data&lt;/th&gt;&lt;th&gt;Design dependency&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;
        &lt;tr&gt;&lt;td&gt;Article or guide&lt;/td&gt;&lt;td&gt;Article and BreadcrumbList&lt;/td&gt;&lt;td&gt;Visible author, dates, headline, image, and breadcrumb route&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Product&lt;/td&gt;&lt;td&gt;Product and offers when eligible&lt;/td&gt;&lt;td&gt;Visible identity, price, availability, media, and genuine review data&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Local business page&lt;/td&gt;&lt;td&gt;Relevant LocalBusiness subtype&lt;/td&gt;&lt;td&gt;Real business details and location-specific visible content&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;Service page&lt;/td&gt;&lt;td&gt;BreadcrumbList is usually the main page-specific markup. Add Organization or LocalBusiness only when it accurately represents the visible business entity and its maintained details.&lt;/td&gt;&lt;td&gt;No invented ratings, locations, or unsupported rich-result promises&lt;/td&gt;&lt;/tr&gt;
      &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;

      &lt;h2 id=&quot;prove-the-design-on-a-production-like-prototype&quot;&gt;8. Prove the design on a production-like prototype&lt;/h2&gt;
      &lt;p&gt;Do not approve SEO from a design file alone. Build at least one production-like page for every high-value template using realistic content, routes, media, scripts, and error states. Inspect the initial response and the rendered page. Crawl the prototype, resize it, navigate by keyboard, submit its forms, disable optional scripts, and test its slowest likely conditions.&lt;/p&gt;
      &lt;ol&gt;
        &lt;li&gt;&lt;strong&gt;Request representative URLs.&lt;/strong&gt; Record response status, redirect destination, headers, canonical, robots directives, and rendered title.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Crawl from the homepage.&lt;/strong&gt; Confirm that intended pages appear through links and unwanted states do not multiply.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Compare mobile and desktop.&lt;/strong&gt; Check content, links, metadata, images, structured data, and working tasks.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Test template extremes.&lt;/strong&gt; Use long headings, missing optional fields, large inventories, no-result states, and validation errors.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Run rich-result, performance, and accessibility checks.&lt;/strong&gt; Treat automated scores as evidence for investigation, not complete approval.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Assign every defect.&lt;/strong&gt; Name the template or component, owner, expected rule, retest, and rollback path.&lt;/li&gt;
      &lt;/ol&gt;

      &lt;h2 id=&quot;use-a-launch-gate-with-named-owners&quot;&gt;9. Use a launch gate with named owners&lt;/h2&gt;
      &lt;p&gt;The final sign-off should be a recorded comparison against the approved page and template contract. Design owns responsive behavior and component states. Development owns rendered output, routing, status codes, and performance implementation. Content owners own page purpose and maintained fields. SEO validates crawlability, index signals, internal discovery, and search-facing output. One person may hold several roles, but no requirement should be ownerless.&lt;/p&gt;
      &lt;p&gt;If the project replaces an existing site, stop here and run the separate migration workflow. Redirect mapping, old-to-new URL reconciliation, baseline crawls, launch monitoring, and rollback are migration work even when the redesign preserves the brand.&lt;/p&gt;

      &lt;h2 id=&quot;what-not-to-do&quot;&gt;What not to do&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Do not approve architecture from the homepage mockup.&lt;/strong&gt; Search visitors can enter through any useful internal page.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not hide essential navigation behind JavaScript events.&lt;/strong&gt; Destinations need resolvable links.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not invent pages after components are finished.&lt;/strong&gt; Page jobs and fields should shape the template.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not remove useful mobile content for visual neatness.&lt;/strong&gt; Rearrange it without changing the page's job.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not add every schema type a plugin offers.&lt;/strong&gt; Mark up visible, supported content only.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not call a Lighthouse score the launch gate.&lt;/strong&gt; Status, links, content, forms, schema, accessibility, and error states need separate tests.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Do not combine a redesign and migration without a baseline.&lt;/strong&gt; Separate the target design from the changeover plan.&lt;/li&gt;
      &lt;/ul&gt;

      &lt;h2 id=&quot;verification-checklist&quot;&gt;Verification checklist&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;Every planned indexable page has a distinct customer or search job.&lt;/li&gt;
        &lt;li&gt;Every important page is reachable through crawlable internal links.&lt;/li&gt;
        &lt;li&gt;URL families have documented status, canonical, index, and sitemap rules.&lt;/li&gt;
        &lt;li&gt;Each template defines required content, metadata, media, schema, and error behavior.&lt;/li&gt;
        &lt;li&gt;Mobile preserves equivalent primary content, headings, links, metadata, and structured data.&lt;/li&gt;
        &lt;li&gt;Navigation, forms, focus states, labels, errors, contrast, and motion have accessibility acceptance tests.&lt;/li&gt;
        &lt;li&gt;Representative templates have media, script, and Core Web Vitals budgets.&lt;/li&gt;
        &lt;li&gt;Structured data represents visible content and passes the relevant feature validation.&lt;/li&gt;
        &lt;li&gt;Production-like pages pass status, crawl, render, mobile, keyboard, form, and failure-state tests.&lt;/li&gt;
        &lt;li&gt;Every launch blocker has an owner, retest, rollback condition, and recorded result.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;The design is SEO-ready when the team can prove how pages are discovered, what each template publishes, how mobile preserves the page job, which URL states are indexable, and what must pass before launch. A polished screenshot is not that proof.&lt;/p&gt;

      &lt;h2 id=&quot;evidence-basis&quot;&gt;Evidence basis&lt;/h2&gt;
      &lt;p&gt;Google Search Central, web.dev, and W3C documentation were checked on August 25, 2026. The page-contract table, prototype sequence, launch ownership model, and acceptance checklist are FloxoLab implementation frameworks. They are not Google ranking factors or guarantees.&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/fundamentals/seo-starter-guide&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: SEO Starter Guide&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/links-crawlable&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: link best practices&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/crawling-indexing/mobile/mobile-sites-mobile-first-indexing&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: mobile-first indexing best practices&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://developers.google.com/search/docs/appearance/structured-data/sd-policies&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;Google Search Central: structured data guidelines&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://web.dev/articles/vitals&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;web.dev: Core Web Vitals and current thresholds&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;https://www.w3.org/WAI/standards-guidelines/wcag/&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;W3C Web Accessibility Initiative: WCAG 2 overview&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;

      &lt;nav class=&quot;article-related&quot; aria-label=&quot;Related reading&quot;&gt;&lt;p class=&quot;article-related-h mono&quot;&gt;Continue the website planning sequence&lt;/p&gt;&lt;ul&gt;
        &lt;li&gt;&amp;lt;a href=&lt;/li&gt;&lt;/ul&gt;&lt;/nav&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/25630/seo-friendly-web-design-checklist-architecture-before-aesthetics</guid>
<pubDate>Sun, 30 Aug 2026 15:50:00 +0000</pubDate>
</item>
<item>
<title>Are Today’s Engineers Getting Soft?</title>
<link>https://coderlegion.com/22518/are-todays-engineers-getting-soft</link>
<description>
&lt;h2 id=&quot;cultivating-genius-the-power-of-constraints-in-modern-engineering&quot;&gt;Cultivating Genius: The Power of Constraints in Modern Engineering&lt;/h2&gt;

&lt;h3 id=&quot;introduction&quot;&gt;Introduction&lt;/h3&gt;

&lt;p&gt;In the opulent landscape of modern software development, we revel in abundance. Gigabytes of RAM are provisioned with a click, terabytes of storage are virtually limitless, and CPU cycles flow like an endless river. This unprecedented access to resources has undeniably accelerated innovation, allowing engineers to build complex systems at a scale unimaginable just decades ago. Yet, a disquieting question often surfaces: are we, amidst this bounty, losing the sharp edge that once defined engineering brilliance? Are we becoming complacent, relying on brute force and ever-increasing hardware rather than the elegant efficiency born from necessity?&lt;/p&gt;

&lt;p&gt;Cast your mind back to the Commodore 64, whose namesake 64KB wasn&amp;rsquo;t a limitation but a crucible. Developers then crafted entire worlds, not despite, but &lt;em&gt;because&lt;/em&gt; of those brutal constraints. Every byte mattered, every clock cycle was a precious resource to be fiercely optimized. This wasn&amp;rsquo;t just about technical skill; it was a mindset, a relentless pursuit of elegance through efficiency. This tutorial explores how embracing a &amp;ldquo;constrained mindset,&amp;rdquo; even in our resource-rich environments, can breed a lot more genius, demonstrating with a simple code example how thoughtful resource management translates into superior engineering.&lt;/p&gt;

&lt;h3 id=&quot;code-layoutwalkthrough-the-efficiency-mindset-in-action&quot;&gt;Code Layout/Walkthrough: The Efficiency Mindset in Action&lt;/h3&gt;

&lt;p&gt;Let&amp;rsquo;s consider a common scenario: processing a large dataset to derive a sum based on certain conditions. In a modern environment, the easiest path often involves loading everything into memory, creating intermediate lists, and then performing calculations. While this works, it can be inefficient and resource-heavy, especially as data scales.&lt;/p&gt;

&lt;p&gt;Here, we&amp;rsquo;ll demonstrate two conceptual approaches to summing a billion numbers, filtering for even numbers &amp;ndash; one that implicitly assumes unlimited resources, and another that actively seeks efficiency by acknowledging potential constraints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Sum all even numbers in a potentially massive sequence of numbers (e.g., from 0 to 1 billion).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Approach 1: The &amp;ldquo;Resource-Agnostic&amp;rdquo; Way (Conceptually)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A straightforward, but less memory-efficient, approach in many languages might involve generating the entire list, then filtering it into a new list, then summing that new list.&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# Conceptual (DO NOT RUN FOR 1 BILLION NUMBERS - will consume excessive memory)
# This example illustrates the *pattern* of creating intermediate lists
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;sum_evens_resource_agnostic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;all_numbers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# Creates a list of 'limit' numbers
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;even_numbers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;all_numbers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# Creates another list
&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;even_numbers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In Python, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;range(limit)&lt;/code&gt; for a billion numbers would already be a memory hog if explicitly converted to a list. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;list&lt;/code&gt; comprehension then creates &lt;em&gt;another&lt;/em&gt; large list. While Python&amp;rsquo;s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;range()&lt;/code&gt; is lazy, explicitly collecting into lists like this for filtering demonstrates the resource-heavy pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Approach 2: The &amp;ldquo;Constraint-Minded&amp;rdquo; Way (Using Generators)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A developer with a &amp;ldquo;constrained mindset&amp;rdquo; would immediately recognize the memory implications and opt for an approach that processes data iteratively, never holding the entire dataset or large intermediate results in memory simultaneously. Python&amp;rsquo;s generators are perfect for this.&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;sum_evens_constraint_minded&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Using a generator expression for numbers
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;numbers_generator&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;limit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; 

    &lt;span class=&quot;c1&quot;&gt;# Filtering and summing in a single pass, without creating intermediate lists
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;total_sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;numbers_generator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;total_sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;num&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;total_sum&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Example Usage (for a smaller limit to quickly see behavior):
# print(sum_evens_constraint_minded(100_000_000)) # This would run efficiently
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sum_evens_constraint_minded&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;range(limit)&lt;/code&gt; is itself a generator (in Python 3). The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(n for n in range(limit))&lt;/code&gt; is a generator expression. Crucially, the loop iterates &lt;em&gt;directly&lt;/em&gt; over these generated numbers, processing each one and adding to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;total_sum&lt;/code&gt; &lt;em&gt;without ever storing all the numbers or all the even numbers in memory&lt;/em&gt;. This dramatically reduces memory footprint, especially for truly massive datasets. It embodies the &amp;ldquo;every byte matters&amp;rdquo; philosophy by processing elements one at a time.&lt;/p&gt;

&lt;p&gt;This isn&amp;rsquo;t just about Python syntax; it&amp;rsquo;s about the underlying architectural thinking: identifying potential resource bottlenecks and designing solutions that gracefully handle them, even before a true &amp;ldquo;scarcity&amp;rdquo; hits.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;The code example, though simple, illustrates a profound principle: a constrained mindset encourages the pursuit of efficiency. It forces us to consider alternatives to brute-force solutions, leading to more elegant, scalable, and resilient architectures. When resources are abundant, it&amp;rsquo;s easy to become complacent, to write code that works but isn&amp;rsquo;t necessarily optimized. But a truly brilliant engineer doesn&amp;rsquo;t just make things work; they make them work &lt;em&gt;well&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Adopting this mindset isn&amp;rsquo;t about artificially creating scarcity but about cultivating an appreciation for every byte and every clock cycle. It&amp;rsquo;s about proactive optimization, designing systems that are inherently efficient from the ground up, rather than patching them later. By engaging with this &amp;ldquo;crucible of constraints,&amp;rdquo; we don&amp;rsquo;t just write better code; we sharpen our problem-solving skills, fostering the kind of creative genius that built entire worlds on 64KB. This pursuit of elegance through efficiency remains, as ever, food for thought for every full-stack engineer.&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/22518/are-todays-engineers-getting-soft</guid>
<pubDate>Tue, 14 Jul 2026 06:42:42 +0000</pubDate>
</item>
<item>
<title>Unity Devs: Stop Starving Your Frame Rate!</title>
<link>https://coderlegion.com/20516/unity-devs-stop-starving-your-frame-rate</link>
<description>
&lt;h2 id=&quot;unity-devs-stop-starving-your-frame-rate-embrace-modern-memory-discipline&quot;&gt;Unity Devs: Stop Starving Your Frame Rate! Embrace Modern Memory Discipline&lt;/h2&gt;

&lt;p&gt;It&amp;rsquo;s 2026, and I&amp;rsquo;m &lt;em&gt;still&lt;/em&gt; seeing incredible Unity games marred by avoidable Garbage Collection (GC) spikes, inexplicably dragging frame rates down from silky smooth to stuttering messes. We&amp;rsquo;ve got powerful tools like Burst, DOTS, and advanced asynchronous patterns at our fingertips, yet many developers are missing the fundamental lesson: memory discipline. Every &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;string&lt;/code&gt; concatenation, every &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; resize without pre-allocation, every casual LINQ query &lt;em&gt;hurts&lt;/em&gt;. These small, seemingly innocuous actions accumulate into significant performance bottlenecks as your game scales.&lt;/p&gt;

&lt;p&gt;The good news is that modern C# offers powerful, accessible solutions. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Span&amp;lt;T&amp;gt;&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Memory&amp;lt;T&amp;gt;&lt;/code&gt;, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ArrayPool&amp;lt;T&amp;gt;&lt;/code&gt; aren&amp;rsquo;t just for optimization gurus anymore; they&amp;rsquo;re &lt;em&gt;mandatory&lt;/em&gt; for any serious C# game developer aiming for consistent, high frame rates. It&amp;rsquo;s time to embrace a data-oriented mindset, even within your MonoBehaviour scripts, and stop treating memory as infinite. Your players (and their frame counters) will thank you.&lt;/p&gt;

&lt;h3 id=&quot;code-layout--walkthrough-taming-allocations&quot;&gt;Code Layout &amp;amp; Walkthrough: Taming Allocations&lt;/h3&gt;

&lt;p&gt;The core problem is the managed heap. When you &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;new&lt;/code&gt; up an object or perform an operation that implicitly allocates memory, that memory needs to be tracked. Eventually, the Garbage Collector (GC) steps in to reclaim unused memory. This process, however, is not free; it causes CPU overhead and can pause your game thread, leading to those dreaded frame spikes. Our goal is to minimize these allocations, especially during hot code paths.&lt;/p&gt;

&lt;h4 id=&quot;1-string-operations-beyond-basic-concatenation&quot;&gt;1. String Operations: Beyond Basic Concatenation&lt;/h4&gt;

&lt;p&gt;Strings are often the silent killers of frame rates because they are immutable. Every time you &amp;ldquo;modify&amp;rdquo; a string (e.g., concatenation with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;+&lt;/code&gt;), you&amp;rsquo;re actually creating an entirely new string in memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problematic Way:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;LogPlayerScore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;playerId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;score&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Each '+' operator creates a new string intermediate&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;log&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Player &quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;playerId&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; scored &quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;score&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; points!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;n&quot;&gt;Debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The Optimized Way (using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;StringBuilder&lt;/code&gt;):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;StringBuilder&lt;/code&gt; allows you to construct strings piece by piece without creating intermediate string objects for each part.&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Use a static/reusable StringBuilder to avoid allocating it repeatedly&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;readonly&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s_stringBuilder&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;StringBuilder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;LogPlayerScoreOptimized&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;playerId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;score&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;s_stringBuilder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Clear&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Clear for reuse&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;s_stringBuilder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Player &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                   &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;playerId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                   &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot; scored &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                   &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;score&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
                   &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot; points!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s_stringBuilder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// One allocation for the final string&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;For advanced scenarios involving parsing or formatting into fixed-size character buffers, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Span&amp;lt;char&amp;gt;&lt;/code&gt; offers direct, allocation-free memory access.&lt;/p&gt;

&lt;h4 id=&quot;2-dynamic-collections--array-pooling&quot;&gt;2. Dynamic Collections &amp;amp; Array Pooling&lt;/h4&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; is convenient, but frequent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;new List&amp;lt;T&amp;gt;()&lt;/code&gt; calls or implicit resizing (when &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Capacity&lt;/code&gt; is exceeded) are major allocation points. For temporary buffers, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ArrayPool&amp;lt;T&amp;gt;&lt;/code&gt; is your best friend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problematic Way:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Vector3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;GetNearbyPositions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Vector3&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Vector3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;positions&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Vector3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Allocation&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// ... logic to populate 'positions' ...&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;positions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Potentially triggers resize allocations during population&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The Optimized Way (using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ArrayPool&amp;lt;T&amp;gt;&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Span&amp;lt;T&amp;gt;&lt;/code&gt;):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ArrayPool&amp;lt;T&amp;gt;&lt;/code&gt; provides a pool of reusable arrays, drastically reducing allocations for temporary collections. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Span&amp;lt;T&amp;gt;&lt;/code&gt; then gives you a high-performance, allocation-free &amp;ldquo;view&amp;rdquo; into that raw array memory.&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Buffers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;UnityEngine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// For Vector3&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;ProcessTemporaryVectorData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Rent a buffer from the shared pool. Avoids allocation if available.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// 'count' should be the maximum expected size.&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Vector3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ArrayPool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Vector3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Shared&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Rent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; 
    
    &lt;span class=&quot;c1&quot;&gt;// Create a Span&amp;lt;Vector3&amp;gt; as a view over the rented buffer&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Span&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Vector3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;AsSpan&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; 

    &lt;span class=&quot;c1&quot;&gt;// Use 'data' (Span&amp;lt;Vector3&amp;gt;) here; operations are allocation-free&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Vector3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Mathf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Mathf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Cos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;$&quot;Processed &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; vectors. First: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]}&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// IMPORTANT: Return the buffer to the pool when you're done.&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ArrayPool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Vector3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Shared&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Return&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Span&amp;lt;T&amp;gt;&lt;/code&gt; allows direct manipulation of the array&amp;rsquo;s elements without any intermediate copies or allocations.&lt;/p&gt;

&lt;h4 id=&quot;3-linqs-hidden-costs&quot;&gt;3. LINQ&amp;rsquo;s Hidden Costs&lt;/h4&gt;

&lt;p&gt;LINQ (Language Integrated Query) is expressive, but many extension methods (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Where&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Select&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;OrderBy&lt;/code&gt;, etc.) implicitly create enumerator objects or even new collections behind the scenes, leading to GC pressure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problematic Way:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Linq&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Requires System.Linq namespace&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;IEnumerable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GameObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;GetActiveEnemies&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GameObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;allObjects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Creates an enumerator object for Where, potentially for ToList()&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;allObjects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Where&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;activeSelf&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;CompareTag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Enemy&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
                     &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;ToList&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Explicitly allocates a new List&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The Optimized Way (Manual Iteration &amp;amp; Reusable Collections):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For performance-critical code, a good old-fashioned loop is often superior. Even better, pass in a pre-allocated &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;List&amp;lt;T&amp;gt;&lt;/code&gt; to store results, effectively eliminating repeat allocations.&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;System.Collections.Generic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;UnityEngine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Pass in a 'results' list to be cleared and reused&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;GetActiveEnemiesNoAlloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GameObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;allObjects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GameObject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Clear&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Clear the existing list for reuse&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;foreach&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;allObjects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;activeSelf&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;CompareTag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Enemy&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;obj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Add to the reusable list&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;results&lt;/code&gt; is only allocated once (or whenever its capacity needs expansion), avoiding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;new List&amp;lt;GameObject&amp;gt;()&lt;/code&gt; every frame or every call.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;GC spikes are not an inevitable evil; they are often a symptom of insufficient memory discipline. By consciously adopting tools like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;StringBuilder&lt;/code&gt; for string manipulation, leveraging &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ArrayPool&amp;lt;T&amp;gt;&lt;/code&gt; for temporary buffers, and embracing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Span&amp;lt;T&amp;gt;&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Memory&amp;lt;T&amp;gt;&lt;/code&gt; for high-performance memory access, you can drastically reduce your game&amp;rsquo;s allocation footprint. Combine this with the practice of reusing collections instead of constantly instantiating new ones, and you&amp;rsquo;ll see tangible improvements.&lt;/p&gt;

&lt;p&gt;Embrace this data-oriented mindset. Understand where your memory is going. Stop treating memory as infinite. Your players will experience smoother, more consistent frame rates, and your game will feel significantly more polished. Start integrating these practices into your Unity projects today.&lt;/p&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/20516/unity-devs-stop-starving-your-frame-rate</guid>
<pubDate>Sat, 13 Jun 2026 11:48:39 +0000</pubDate>
</item>
<item>
<title>Spec-Driven Development Isn’t Waterfall — But It Keeps Ending Up There</title>
<link>https://coderlegion.com/15087/spec-driven-development-isnt-waterfall-but-it-keeps-ending-up-there</link>
<description>
&lt;p&gt;&lt;em&gt;Spec-driven development isn&amp;rsquo;t supposed to be waterfall. But without clear workflows and better tooling, it&amp;rsquo;s easy to end up there.&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;I recently went deep on spec-driven development. The idea was straightforward: before writing any code, define everything. The full vision, the context, the trade-offs, where the feature fits in the existing architecture, the references. Hand it all to the AI agent with crystal-clear guidance so it can build with minimal supervision.&lt;/p&gt;



&lt;p&gt;It looked promising. For about two days.&lt;/p&gt;



&lt;p&gt;What I ended up with was thousands of lines of specification documents. Documents that were incredibly hard to review &amp;mdash; not because they were poorly structured, but because most of them were generated by the AI itself, correlating the existing architecture, docs, and my guidance into something that &lt;em&gt;looked&lt;/em&gt; authoritative. Clear explanations. Perfect formatting. Confident reasoning about every decision.&lt;/p&gt;



&lt;p&gt;And that&amp;rsquo;s exactly where it got scary.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Confidence Problem Nobody Mentions&lt;/h2&gt;



&lt;p&gt;Here&amp;rsquo;s the thing about AI-generated specs that the SDD evangelists aren&amp;rsquo;t talking about: &lt;strong&gt;the AI makes everything look correct.&lt;/strong&gt;&lt;/p&gt;



&lt;p&gt;When a spec is well-formatted, internally consistent, and confidently explained, your brain wants to trust it. It reads like something a senior architect wrote after careful deliberation. But it&amp;rsquo;s not. It&amp;rsquo;s a language model pattern-matching against your inputs, producing the most plausible-sounding output it can.&lt;/p&gt;



&lt;p&gt;And here&amp;rsquo;s the trap within the trap: if you push back on something that feels off, the AI doesn&amp;rsquo;t defend its reasoning. It folds. It assumes you&amp;rsquo;re right, tries to course correct, and often makes the output &lt;em&gt;worse&lt;/em&gt;. Hallucination risk actually goes up when you question it, because now it&amp;rsquo;s reconciling your objection with a position it never truly held. It&amp;rsquo;s not reasoning. It&amp;rsquo;s pleasing.&lt;/p&gt;



&lt;p&gt;So you&amp;rsquo;re stuck. Trust the spec and risk building on wrong assumptions. Question the spec and risk destabilizing it further. Either way, you&amp;rsquo;ve generated thousands of lines of documentation that are incredibly hard to confidently validate.&lt;/p&gt;



&lt;p&gt;After spending far too long trying to get those specs to a place I trusted, it hit me &amp;mdash; this felt familiar.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Intent vs. the Reality&lt;/h2&gt;



&lt;p&gt;Here&amp;rsquo;s where I want to be fair: spec-driven development isn&amp;rsquo;t &lt;em&gt;supposed&lt;/em&gt; to be big design upfront.&lt;/p&gt;



&lt;p&gt;Marc Brooker, the person building Kiro at AWS, explicitly says &amp;ldquo;you don&amp;rsquo;t need to, and probably shouldn&amp;rsquo;t, develop the entire specification upfront.&amp;rdquo; Kiro&amp;rsquo;s own workflow is feature-scoped &amp;mdash; requirements, design, and tasks for a single story, not a whole system. GitHub&amp;rsquo;s Spec-Kit runs in a loop: specify, plan, tasks, repeat per change request. OpenSpec literally states &amp;ldquo;specs are not frozen contracts; update them when reality changes.&amp;rdquo;&lt;/p&gt;



&lt;p&gt;The &lt;em&gt;vision&lt;/em&gt; of SDD is iterative. Living documents. Feature-level scope. Incremental refinement.&lt;/p&gt;



&lt;p&gt;But the vision and the practice aren&amp;rsquo;t the same thing yet.&lt;/p&gt;



&lt;p&gt;Birgitta B&amp;ouml;ckeler, writing on Martin Fowler&amp;rsquo;s site, tried to untangle what SDD actually means right now and found the definition &amp;ldquo;still in flux.&amp;rdquo; She identified three levels &amp;mdash; spec-first, spec-anchored, and spec-as-source &amp;mdash; and noted that most tools are only spec-first. They help you write a spec before coding, but don&amp;rsquo;t have clear strategies for maintaining or evolving that spec over time. Even GitHub Spec-Kit&amp;rsquo;s own community is confused about whether a spec is supposed to live beyond a single change request.&lt;/p&gt;



&lt;p&gt;The methodology is ahead of the tooling. SDD can absolutely work &amp;mdash; but right now, the tools and workflows don&amp;rsquo;t do enough to keep you on the iterative path. Without clear guardrails for when to stop specifying and start building, teams default to the thing that feels most natural: writing everything down upfront, as thoroughly as possible, before anyone touches code.&lt;/p&gt;



&lt;p&gt;That&amp;rsquo;s what happened to me. Not because I didn&amp;rsquo;t know better. Because nothing in the workflow guided me toward &amp;ldquo;that&amp;rsquo;s enough, go build and come back.&amp;rdquo;&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Waterfall Gravity&lt;/h2&gt;



&lt;p&gt;There&amp;rsquo;s a reason teams keep falling into this pattern. It has gravitational pull.&lt;/p&gt;



&lt;p&gt;When you tell an AI agent to help you write a spec, it &lt;em&gt;wants&lt;/em&gt; to be comprehensive. It will map out every component, every edge case, every integration point &amp;mdash; because that&amp;rsquo;s what &amp;ldquo;thorough&amp;rdquo; looks like in its training data. And as a developer, you &lt;em&gt;want&lt;/em&gt; to feel like you&amp;rsquo;ve thought of everything before handing off to an autonomous agent. The combination of an AI that defaults to exhaustive and a human who defaults to cautious creates thousands of lines of documentation almost by accident.&lt;/p&gt;



&lt;p&gt;This is the same dynamic that made waterfall feel so appealing in the first place. The Agile Manifesto exists because planning everything upfront didn&amp;rsquo;t work:&lt;/p&gt;



&lt;blockquote class=&quot;wp-block-quote is-layout-flow wp-block-quote-is-layout-flow&quot;&gt;
&lt;p&gt;Responding to change over following a plan.&lt;/p&gt;
&lt;/blockquote&gt;



&lt;p&gt;SDD proponents will rightly say &amp;ldquo;that&amp;rsquo;s not what we&amp;rsquo;re advocating.&amp;rdquo; And they&amp;rsquo;re right. But the tooling needs to actively enforce iterative scope &amp;mdash; otherwise that gravity keeps pulling teams toward specifying everything before building anything. The intent is agile. The default behavior, without better rails, is waterfall.&lt;/p&gt;



&lt;p&gt;Of course, agile itself got convoluted over the years. Certifications, rituals, dogma that drifted far from the original insight. But the core idea never stopped being true: you learn more from building than from planning.&lt;/p&gt;



&lt;p&gt;Thoughtworks &amp;mdash; the company whose chief scientist co-authored the Agile Manifesto &amp;mdash; just released Technology Radar v34 this week, warning that as AI accelerates code generation, &amp;ldquo;established practices that ensure discipline become more vital.&amp;rdquo; They&amp;rsquo;re not pushing SDD. They&amp;rsquo;re pushing fundamentals. Iteration. Feedback loops.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;What SDD Gets Right&lt;/h2&gt;



&lt;p&gt;I don&amp;rsquo;t want to dismiss the methodology. There are real benefits when it works.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Agents need constraints.&lt;/strong&gt; Without scope boundaries, they expand. Tell an agent to build auth and it&amp;rsquo;ll add OAuth, SSO, and MFA because that&amp;rsquo;s what &amp;ldquo;auth&amp;rdquo; means in its training data. A spec that says &amp;ldquo;OAuth is out of scope&amp;rdquo; genuinely saves time.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Context improves quality.&lt;/strong&gt; An agent with the full picture makes fewer locally-right-but-globally-wrong decisions. The spec gives it a map, not just turn-by-turn directions.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Team alignment.&lt;/strong&gt; Multiple people or agents working on the same system need a shared reference point. Specs provide that.&lt;/p&gt;



&lt;p&gt;The problem was never &amp;ldquo;should we spec?&amp;rdquo; It&amp;rsquo;s &amp;ldquo;how do we make sure we spec iteratively instead of falling into the trap of specifying everything at once?&amp;rdquo;&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Thinking in Graphs&lt;/h2&gt;



&lt;p&gt;Here&amp;rsquo;s where I&amp;rsquo;ve landed &amp;mdash; and maybe this is just how my brain works, but I think it applies broadly.&lt;/p&gt;



&lt;p&gt;I think about projects as graphs, not documents.&lt;/p&gt;



&lt;p&gt;At the top, there&amp;rsquo;s a direction. A north star. What we&amp;rsquo;re building and why. High-level, intentional, human-defined. It doesn&amp;rsquo;t need to specify every data model or API contract. It needs to be clear about the destination.&lt;/p&gt;



&lt;p&gt;From that direction, you break down into milestones. Each milestone is a meaningful checkpoint &amp;mdash; something you can ship, test, or validate. Not a document section. A real deliverable.&lt;/p&gt;



&lt;p&gt;Each milestone has its own tasks. And here&amp;rsquo;s the critical part: &lt;strong&gt;the depth of planning for each task happens when you start working on it, not months before.&lt;/strong&gt; You plan the first milestone in detail. You sketch milestone three at a high level. When you finish milestone one, you know things you didn&amp;rsquo;t know before &amp;mdash; and that knowledge shapes how you plan milestone two.&lt;/p&gt;



&lt;p&gt;The direction flows down from the north star. Discovery happens at every node.&lt;/p&gt;



&lt;p&gt;Say you&amp;rsquo;re building a new integration. The north star says: &amp;ldquo;Users can sync data between System A and System B in real time.&amp;rdquo; Milestone one might be a basic one-way sync &amp;mdash; and when you build it, you discover the API rate limits aren&amp;rsquo;t what the docs claimed. That changes everything about milestone two. If you&amp;rsquo;d fully specced bidirectional sync upfront, you&amp;rsquo;d be rewriting specs instead of shipping software.&lt;/p&gt;



&lt;p&gt;This works for humans because it provides structure without drowning you in premature detail. It works for AI agents for the same reason &amp;mdash; they need guidance and constraints, but they also need room to discover things during implementation that no spec could have predicted.&lt;/p&gt;



&lt;p&gt;Full upfront specification tries to flatten the graph into a document. Every node defined, every edge mapped, before you&amp;rsquo;ve traversed any of them. That&amp;rsquo;s not engineering. That&amp;rsquo;s prophecy.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;What This Looks Like in Practice&lt;/h2&gt;



&lt;p&gt;I&amp;rsquo;m still figuring this out. There is no perfect workflow yet &amp;mdash; that&amp;rsquo;s kind of the point. But here&amp;rsquo;s the pattern that&amp;rsquo;s working:&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Thin specs, not thick ones.&lt;/strong&gt; One page for the current milestone, not twenty pages for the whole system. Define the outcome, the constraints, what&amp;rsquo;s out of scope. Leave room for what you don&amp;rsquo;t know yet.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Iterate the spec, not just the code.&lt;/strong&gt; The spec changes every cycle. Decisions made, assumptions validated or invalidated, things learned by building. A living document, not a contract. This is what SDD&amp;rsquo;s proponents advocate &amp;mdash; we just need clearer workflows and tooling to make this the default path instead of something you have to consciously enforce.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Use agents for exploration, not just execution.&lt;/strong&gt; Code is cheap now. Build a quick prototype to test an architectural assumption. Throw it away if it&amp;rsquo;s wrong. A throwaway prototype costs you nothing. Specifying the wrong architecture upfront costs you everything.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Keep the loop tight.&lt;/strong&gt; In traditional agile, the sprint was two weeks. With agents, the feedback loop can be hours. Specify, build, test, learn, adjust. But only if you keep the scope small enough to actually iterate.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Gap That Needs Filling&lt;/h2&gt;



&lt;p&gt;The industry is living through a real-time methodology shift:&lt;/p&gt;



&lt;ol class=&quot;wp-block-list&quot;&gt;
&lt;li&gt;&lt;strong&gt;Vibe coding&lt;/strong&gt; &amp;mdash; prompt and pray. Fast, chaotic, doesn&amp;rsquo;t scale.&lt;/li&gt;



&lt;li&gt;&lt;strong&gt;Spec-driven development&lt;/strong&gt; &amp;mdash; specify, then execute. Sound in theory, but easy to fall into big design upfront without clear process guardrails.&lt;/li&gt;



&lt;li&gt;&lt;strong&gt;What comes next&lt;/strong&gt; &amp;mdash; the iterative spec workflow that SDD envisions, supported by tooling and processes that actively keep teams on that path. Thin specs. Fast execution. Continuous refinement. Direction without prophecy.&lt;/li&gt;
&lt;/ol&gt;



&lt;p&gt;This is the same arc software development has followed before. Waterfall promised control through upfront planning. Agile recognized that the plan always changes. We&amp;rsquo;re at that inflection point again &amp;mdash; the insight of iterative development needs to be baked into the tools and workflows, not just the blog posts and documentation.&lt;/p&gt;



&lt;p&gt;A project with a clear direction, meaningful milestones, and task-level depth that&amp;rsquo;s earned at execution time &amp;mdash; not guessed at months before &amp;mdash; works for both humans and AI agents. Structure without rigidity. Guidance without false certainty.&lt;/p&gt;



&lt;p&gt;The agents are fast. The models are capable. But the bottleneck was never the code.&lt;/p&gt;



&lt;p&gt;It was knowing what to build. And you only learn that by building.&lt;/p&gt;



&lt;hr class=&quot;wp-block-separator has-alpha-channel-opacity&quot;&gt;



&lt;p&gt;&lt;em&gt;Spec-driven development&amp;rsquo;s vision is right: specs should be living, iterative, and at the center of how we build software with AI. What we need now is better tooling and clearer processes to make that vision the default &amp;mdash; so teams stay on the iterative path instead of drifting into the upfront-planning trap that agile was invented to escape. The Agile Manifesto didn&amp;rsquo;t expire. It just got a new executor &amp;mdash; and that executor needs better guardrails.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The post &lt;a rel=&quot;nofollow&quot; href=&quot;https://sudoish.com/spec-driven-development-waterfall-trap/&quot;&gt;Spec-Driven Development Isn&amp;rsquo;t Waterfall &amp;mdash; But It Keeps Ending Up There&lt;/a&gt; appeared first on &lt;a rel=&quot;nofollow&quot; href=&quot;https://sudoish.com&quot;&gt;sudoish&lt;/a&gt;.&lt;/p&gt;

</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/15087/spec-driven-development-isnt-waterfall-but-it-keeps-ending-up-there</guid>
<pubDate>Sat, 18 Apr 2026 00:59:46 +0000</pubDate>
</item>
<item>
<title>Introduction to Go generics?</title>
<link>https://coderlegion.com/13377/introduction-to-go-generics</link>
<description>
&lt;p&gt;&lt;em&gt;Hello, I'm Ganesh Kumar. I'm working on &lt;a href=&quot;https://hexmos.com/livereview/git-lrc/&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;git-lrc&lt;/a&gt;: a Git hook for Checking AI generated code.AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In my previous post, I explained how to work with an interface.&lt;/p&gt;

&lt;p&gt;Now let's understand go generics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is Go Generics needed?
&lt;/h2&gt;

&lt;p&gt;Before I start explaining go generics, let me give an example of a simple code without using go generics.&lt;/p&gt;

&lt;p&gt;Let's have a simple function for finding the index of the element.&lt;br&gt;
We can see that both internal workings are the same, but the parameters and return variable types are different&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;


&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;



&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IndexInt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;range&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;
 &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

 &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IndexString&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;range&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;
 &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

 &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;integer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;45&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IndexInt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;integer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; 

    &lt;span class=&quot;n&quot;&gt;strings&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;world&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IndexString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;strings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;example&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As we can see, both are working in the same way.&lt;br&gt;
Output:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;gk@jarvis:~/exp/code/rd/go-exmaple&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;go run main.go 
3
&lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;So, why can't we have a single function that does the same task with passing different types? This is how go generics play a major role in this.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Go Generics?
&lt;/h2&gt;

&lt;p&gt;It is a feature that allows developers to write reusable, type-safe code that works with multiple types.&lt;/p&gt;

&lt;p&gt;That means we can use Go generics to solve our problem.&lt;/p&gt;

&lt;p&gt;In the example below, we will solve the above problem. &lt;/p&gt;
&lt;h2&gt;
  
  
  Using Go Generics
&lt;/h2&gt;

&lt;p&gt;There are many constraints to using go generics.&lt;/p&gt;

&lt;p&gt;For our case let's just use a &lt;code&gt;comparable&lt;/code&gt; constraint.&lt;/p&gt;

&lt;p&gt;let't create function &lt;code&gt;Index&lt;/code&gt; with &lt;code&gt;[T comparable]&lt;/code&gt; with using T as type.&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;



&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;comparable&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;range&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;
 &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

 &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;integer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;45&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;integer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; 

    &lt;span class=&quot;n&quot;&gt;strings&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;world&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;strings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;example&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As we expected, we got the same results with one function.&lt;/p&gt;

&lt;p&gt;Output&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;gk@jarvis:~/exp/code/rd/go-exmaple&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;go run main.go 
3
&lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;Go Generics was introduced recently we might be using it in a few cases where it is necessary.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://hexmos.com/livereview/git-lrc/&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;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%2Fifqf83t1qjl4u0g6aj4l.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;381&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; Check out: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;git-lrc&lt;/a&gt;&lt;br&gt;
Any feedback or contributors are welcome! It&amp;rsquo;s online, open-source, and ready for anyone to use.&lt;br&gt;
&amp;#11088; Star it on GitHub:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;ltag-github-readme-tag&quot;&gt;
  &lt;div class=&quot;readme-overview&quot;&gt;
    &lt;h2&gt;
      &lt;img src=&quot;https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg&quot; alt=&quot;GitHub logo&quot;&gt;
      &lt;a href=&quot;https://github.com/HexmosTech&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;
        HexmosTech
      &lt;/a&gt; / &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;
        git-lrc
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Free, Unlimited AI Code Reviews That Run on Commit
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class=&quot;ltag-github-body&quot;&gt;
    
&lt;div id=&quot;readme&quot; class=&quot;md&quot;&gt;
&lt;div&gt;
&lt;a rel=&quot;noopener noreferrer nofollow&quot; href=&quot;https://camo.githubusercontent.com/948c8f2d5cf41b48985cd364d48c3a2dc9bfbfd42eab3e0a9a1b3e61f5f17ce3/68747470733a2f2f6865786d6f732e636f6d2f66726565646576746f6f6c732f7075626c69632f6c725f6c6f676f2e737667&quot;&gt;&lt;img width=&quot;60&quot; alt=&quot;git-lrc logo&quot; src=&quot;https://camo.githubusercontent.com/948c8f2d5cf41b48985cd364d48c3a2dc9bfbfd42eab3e0a9a1b3e61f5f17ce3/68747470733a2f2f6865786d6f732e636f6d2f66726565646576746f6f6c732f7075626c69632f6c725f6c6f676f2e737667&quot;&gt;&lt;/a&gt;
&lt;p&gt;&lt;strong&gt;git-lrc&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Free, Unlimited AI Code Reviews That Run on Commit&lt;/strong&gt;&lt;/p&gt;
&lt;br&gt;
&lt;/div&gt;



&lt;div&gt;
&lt;a href=&quot;https://www.producthunt.com/products/git-lrc?embed=true&amp;amp;utm_source=badge-top-post-badge&amp;amp;utm_medium=badge&amp;amp;utm_campaign=badge-git-lrc&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;&lt;img alt=&quot;git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt&quot; width=&quot;250&quot; height=&quot;54&quot; src=&quot;https://camo.githubusercontent.com/87bf2d4283c1e0aa99e254bd17fefb1c67c0c0d39300043a243a4aa633b6cecc/68747470733a2f2f6170692e70726f6475637468756e742e636f6d2f776964676574732f656d6265642d696d6167652f76312f746f702d706f73742d62616467652e7376673f706f73745f69643d31303739323632267468656d653d6c6967687426706572696f643d6461696c7926743d31373731373439313730383638&quot;&gt;&lt;/a&gt;
&lt;/div&gt;




&lt;p&gt;AI agents write code fast. They also &lt;em&gt;silently remove logic&lt;/em&gt;, change behavior, and introduce bugs -- without telling you. You often find out in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git-lrc&lt;/code&gt; fixes this.&lt;/strong&gt; It hooks into &lt;code&gt;git commit&lt;/code&gt; and reviews every diff &lt;em&gt;before&lt;/em&gt; it lands. 60-second setup. Completely free.&lt;/p&gt;

&lt;div class=&quot;markdown-heading&quot;&gt;
&lt;h2 class=&quot;heading-element&quot;&gt;See It In Action&lt;/h2&gt;
&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;See git-lrc catch serious security issues such as leaked credentials, expensive cloud
operations, and sensitive material in log statements&lt;/p&gt;
&lt;/blockquote&gt;


  
    

    &lt;span class=&quot;m-1&quot;&gt;git-lrc-intro-60s.mp4&lt;/span&gt;
  

  

  


&lt;div class=&quot;markdown-heading&quot;&gt;
&lt;h2 class=&quot;heading-element&quot;&gt;Why&lt;/h2&gt;

&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt; &lt;strong&gt;AI agents silently break things.&lt;/strong&gt; Code removed. Logic changed. Edge cases gone. You won't notice until production.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Catch it before it ships.&lt;/strong&gt; AI-powered inline comments show you &lt;em&gt;exactly&lt;/em&gt; what changed and what looks wrong.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Build a habit, ship better code.&lt;/strong&gt; Regular review &amp;rarr; fewer bugs &amp;rarr; more robust code &amp;rarr; better results in your team.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Why git?&lt;/strong&gt; Git is universal. Every editor, every IDE, every AI&amp;hellip;&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class=&quot;gh-btn-container&quot;&gt;&lt;a class=&quot;gh-btn&quot; href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;



</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/13377/introduction-to-go-generics</guid>
<pubDate>Mon, 30 Mar 2026 21:36:35 +0000</pubDate>
</item>
<item>
<title>Understanding Methods in Go</title>
<link>https://coderlegion.com/13379/understanding-methods-in-go</link>
<description>
&lt;p&gt;&lt;em&gt;Hello, I'm Ganesh Kumar. I'm working on &lt;a href=&quot;https://hexmos.com/livereview/git-lrc/&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;git-lrc&lt;/a&gt;: a Git hook for Checking AI generated code.AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In my previous post, I explained how closure works.&lt;/p&gt;

&lt;p&gt;In this article we will understand how to method works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method
&lt;/h2&gt;

&lt;p&gt;Method is a function with a receiver. &lt;/p&gt;

&lt;p&gt;This works like a class method in other languages.&lt;/p&gt;

&lt;p&gt;Here is the example of method.&lt;/p&gt;

&lt;p&gt;let's define a struct value and add method to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Y&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;



&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;X&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Y&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;val2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;val2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;gk@jarvis:~/exp/code/rd/go-exmaple&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;go run main.go 
3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is a simple example of method.&lt;/p&gt;
&lt;h2&gt;
  
  
  Pointer receiver
&lt;/h2&gt;

&lt;p&gt;Pointer receiver is used to modify the value of the struct.&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Y&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;



&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;X&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Y&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;X&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Y&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;gk@jarvis:~/exp/code/rd/go-exmaple&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;go run main.go 
3
2 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;From this we can see that pointer receiver is used to modify the value of the struct.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article we understood how method works and how pointer receiver is used to modify the value of the struct.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://hexmos.com/livereview/git-lrc/&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;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%2Fifqf83t1qjl4u0g6aj4l.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;381&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; Check out: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;git-lrc&lt;/a&gt;&lt;br&gt;
Any feedback or contributors are welcome! It&amp;rsquo;s online, open-source, and ready for anyone to use.&lt;br&gt;
&amp;#11088; Star it on GitHub:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;ltag-github-readme-tag&quot;&gt;
  &lt;div class=&quot;readme-overview&quot;&gt;
    &lt;h2&gt;
      &lt;img src=&quot;https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg&quot; alt=&quot;GitHub logo&quot;&gt;
      &lt;a href=&quot;https://github.com/HexmosTech&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;
        HexmosTech
      &lt;/a&gt; / &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;
        git-lrc
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Free, Unlimited AI Code Reviews That Run on Commit
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class=&quot;ltag-github-body&quot;&gt;
    
&lt;div class=&quot;md&quot;&gt;
&lt;div&gt;
&lt;a rel=&quot;noopener noreferrer nofollow&quot; href=&quot;https://camo.githubusercontent.com/948c8f2d5cf41b48985cd364d48c3a2dc9bfbfd42eab3e0a9a1b3e61f5f17ce3/68747470733a2f2f6865786d6f732e636f6d2f66726565646576746f6f6c732f7075626c69632f6c725f6c6f676f2e737667&quot;&gt;&lt;img width=&quot;60&quot; alt=&quot;git-lrc logo&quot; src=&quot;https://camo.githubusercontent.com/948c8f2d5cf41b48985cd364d48c3a2dc9bfbfd42eab3e0a9a1b3e61f5f17ce3/68747470733a2f2f6865786d6f732e636f6d2f66726565646576746f6f6c732f7075626c69632f6c725f6c6f676f2e737667&quot;&gt;&lt;/a&gt;
&lt;p&gt;&lt;strong&gt;git-lrc&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Free, Unlimited AI Code Reviews That Run on Commit&lt;/strong&gt;&lt;/p&gt;
&lt;br&gt;
&lt;/div&gt;



&lt;div&gt;
&lt;a href=&quot;https://www.producthunt.com/products/git-lrc?embed=true&amp;amp;utm_source=badge-top-post-badge&amp;amp;utm_medium=badge&amp;amp;utm_campaign=badge-git-lrc&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;&lt;img alt=&quot;git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt&quot; width=&quot;250&quot; height=&quot;54&quot; src=&quot;https://camo.githubusercontent.com/87bf2d4283c1e0aa99e254bd17fefb1c67c0c0d39300043a243a4aa633b6cecc/68747470733a2f2f6170692e70726f6475637468756e742e636f6d2f776964676574732f656d6265642d696d6167652f76312f746f702d706f73742d62616467652e7376673f706f73745f69643d31303739323632267468656d653d6c6967687426706572696f643d6461696c7926743d31373731373439313730383638&quot;&gt;&lt;/a&gt;
&lt;/div&gt;




&lt;p&gt;AI agents write code fast. They also &lt;em&gt;silently remove logic&lt;/em&gt;, change behavior, and introduce bugs -- without telling you. You often find out in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git-lrc&lt;/code&gt; fixes this.&lt;/strong&gt; It hooks into &lt;code&gt;git commit&lt;/code&gt; and reviews every diff &lt;em&gt;before&lt;/em&gt; it lands. 60-second setup. Completely free.&lt;/p&gt;

&lt;div class=&quot;markdown-heading&quot;&gt;
&lt;h2 class=&quot;heading-element&quot;&gt;See It In Action&lt;/h2&gt;
&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;See git-lrc catch serious security issues such as leaked credentials, expensive cloud
operations, and sensitive material in log statements&lt;/p&gt;
&lt;/blockquote&gt;


  
    

    &lt;span class=&quot;m-1&quot;&gt;git-lrc-intro-60s.mp4&lt;/span&gt;
  

  

  


&lt;div class=&quot;markdown-heading&quot;&gt;
&lt;h2 class=&quot;heading-element&quot;&gt;Why&lt;/h2&gt;

&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt; &lt;strong&gt;AI agents silently break things.&lt;/strong&gt; Code removed. Logic changed. Edge cases gone. You won't notice until production.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Catch it before it ships.&lt;/strong&gt; AI-powered inline comments show you &lt;em&gt;exactly&lt;/em&gt; what changed and what looks wrong.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Build a habit, ship better code.&lt;/strong&gt; Regular review &amp;rarr; fewer bugs &amp;rarr; more robust code &amp;rarr; better results in your team.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Why git?&lt;/strong&gt; Git is universal. Every editor, every IDE, every AI&amp;hellip;&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class=&quot;gh-btn-container&quot;&gt;&lt;a class=&quot;gh-btn&quot; href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;



</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/13379/understanding-methods-in-go</guid>
<pubDate>Wed, 25 Mar 2026 22:30:59 +0000</pubDate>
</item>
<item>
<title>Understanding Anonymous Functions in Go</title>
<link>https://coderlegion.com/13381/understanding-anonymous-functions-in-go</link>
<description>
&lt;p&gt;&lt;em&gt;Hello, I'm Ganesh Kumar. I'm working on &lt;a href=&quot;https://hexmos.com/livereview/git-lrc/&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;git-lrc&lt;/a&gt;: a Git hook for Checking AI generated code.AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In my previous post, I explained what are maps and how to create them.&lt;/p&gt;

&lt;p&gt;Now let's see how anonymous functions created and understand how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anonymous functions
&lt;/h2&gt;

&lt;p&gt;We assign a function to a variable and then call it.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;Hello World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Similarly we can also pass arguments to the anonymous function.&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;dev&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;to&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;dev to
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Passing function as an argument
&lt;/h2&gt;

&lt;p&gt;We are passing a function as an argument to another function.&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;anonymous&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;anonymous&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;Hello World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If we want to pass arguments to the anonymous function, we can do it like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;anonymous&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;dev&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;to&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;anonymous&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;As is the print statement is inside the anonymous function, it is printing the values passed to it.&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;dev to
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;We understood how the anonymous functions are created and how to pass them as arguments to another function.&lt;/p&gt;

&lt;p&gt;As go has the feature of passing functions as arguments to another function, go provides a feature called closure.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://hexmos.com/livereview/git-lrc/&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;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%2Fifqf83t1qjl4u0g6aj4l.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;381&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; Check out: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;git-lrc&lt;/a&gt;&lt;br&gt;
Any feedback or contributors are welcome! It&amp;rsquo;s online, open-source, and ready for anyone to use.&lt;br&gt;
&amp;#11088; Star it on GitHub:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;ltag-github-readme-tag&quot;&gt;
  &lt;div class=&quot;readme-overview&quot;&gt;
    &lt;h2&gt;
      &lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg&quot; alt=&quot;GitHub logo&quot;&gt;
      &lt;a href=&quot;https://github.com/HexmosTech&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;
        HexmosTech
      &lt;/a&gt; / &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;
        git-lrc
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Free, Unlimited AI Code Reviews That Run on Commit
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class=&quot;ltag-github-body&quot;&gt;
    
&lt;div class=&quot;md&quot;&gt;
&lt;div&gt;
&lt;a rel=&quot;noopener noreferrer nofollow&quot; href=&quot;https://camo.githubusercontent.com/948c8f2d5cf41b48985cd364d48c3a2dc9bfbfd42eab3e0a9a1b3e61f5f17ce3/68747470733a2f2f6865786d6f732e636f6d2f66726565646576746f6f6c732f7075626c69632f6c725f6c6f676f2e737667&quot;&gt;&lt;img width=&quot;60&quot; alt=&quot;git-lrc logo&quot; src=&quot;https://camo.githubusercontent.com/948c8f2d5cf41b48985cd364d48c3a2dc9bfbfd42eab3e0a9a1b3e61f5f17ce3/68747470733a2f2f6865786d6f732e636f6d2f66726565646576746f6f6c732f7075626c69632f6c725f6c6f676f2e737667&quot;&gt;&lt;/a&gt;
&lt;p&gt;&lt;strong&gt;git-lrc&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Free, Unlimited AI Code Reviews That Run on Commit&lt;/strong&gt;&lt;/p&gt;
&lt;br&gt;
&lt;/div&gt;



&lt;div&gt;
&lt;a href=&quot;https://www.producthunt.com/products/git-lrc?embed=true&amp;amp;utm_source=badge-top-post-badge&amp;amp;utm_medium=badge&amp;amp;utm_campaign=badge-git-lrc&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;&lt;img alt=&quot;git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt&quot; width=&quot;250&quot; height=&quot;54&quot; src=&quot;https://camo.githubusercontent.com/87bf2d4283c1e0aa99e254bd17fefb1c67c0c0d39300043a243a4aa633b6cecc/68747470733a2f2f6170692e70726f6475637468756e742e636f6d2f776964676574732f656d6265642d696d6167652f76312f746f702d706f73742d62616467652e7376673f706f73745f69643d31303739323632267468656d653d6c6967687426706572696f643d6461696c7926743d31373731373439313730383638&quot;&gt;&lt;/a&gt;
&lt;/div&gt;




&lt;p&gt;AI agents write code fast. They also &lt;em&gt;silently remove logic&lt;/em&gt;, change behavior, and introduce bugs -- without telling you. You often find out in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git-lrc&lt;/code&gt; fixes this.&lt;/strong&gt; It hooks into &lt;code&gt;git commit&lt;/code&gt; and reviews every diff &lt;em&gt;before&lt;/em&gt; it lands. 60-second setup. Completely free.&lt;/p&gt;

&lt;div class=&quot;markdown-heading&quot;&gt;
&lt;h2 class=&quot;heading-element&quot;&gt;See It In Action&lt;/h2&gt;
&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;See git-lrc catch serious security issues such as leaked credentials, expensive cloud
operations, and sensitive material in log statements&lt;/p&gt;
&lt;/blockquote&gt;


  
    

    &lt;span class=&quot;m-1&quot;&gt;git-lrc-intro-60s.mp4&lt;/span&gt;
  

  

  


&lt;div class=&quot;markdown-heading&quot;&gt;
&lt;h2 class=&quot;heading-element&quot;&gt;Why&lt;/h2&gt;

&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt; &lt;strong&gt;AI agents silently break things.&lt;/strong&gt; Code removed. Logic changed. Edge cases gone. You won't notice until production.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Catch it before it ships.&lt;/strong&gt; AI-powered inline comments show you &lt;em&gt;exactly&lt;/em&gt; what changed and what looks wrong.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Build a habit, ship better code.&lt;/strong&gt; Regular review &amp;rarr; fewer bugs &amp;rarr; more robust code &amp;rarr; better results in your team.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Why git?&lt;/strong&gt; Git is universal. Every editor, every IDE, every AI&amp;hellip;&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class=&quot;gh-btn-container&quot;&gt;&lt;a class=&quot;gh-btn&quot; href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;&lt;a href=&quot;https://github.com/golang/go/blob/master/src/runtime/slice.go&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://github.com/golang/go/blob/master/src/runtime/slice.go&lt;/a&gt;&lt;/p&gt;


</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/13381/understanding-anonymous-functions-in-go</guid>
<pubDate>Mon, 23 Mar 2026 22:29:30 +0000</pubDate>
</item>
<item>
<title>Understanding Closures in Go</title>
<link>https://coderlegion.com/13380/understanding-closures-in-go</link>
<description>
&lt;p&gt;&lt;em&gt;Hello, I'm Ganesh Kumar. I'm working on &lt;a href=&quot;https://hexmos.com/livereview/git-lrc/&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;git-lrc&lt;/a&gt;: a Git hook for Checking AI generated code.AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In my previous post, I explained how anonymous functions created and understand how it works.&lt;/p&gt;

&lt;p&gt;In this article we will understand how closure.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is closure
&lt;/h2&gt;

&lt;p&gt;A closure is a function value that references variables from outside its body. &lt;/p&gt;

&lt;p&gt;The function may access and assign to the referenced variables; in this sense the function is &quot;bound&quot; to the variables.&lt;/p&gt;

&lt;h2&gt;
  
  
  How closure is used?
&lt;/h2&gt;

&lt;p&gt;Each time new value updates the sum variable.&lt;/p&gt;

&lt;p&gt;Next time when we call the function, it will use the updated value of sum.&lt;/p&gt;

&lt;p&gt;So, It remembers the value of sum.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;
&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;adder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;sum&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sum&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;


&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;pos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;neg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;adder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;adder&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;pos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;neg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;gk@jarvis:~/exp/code/rd/go-exmaple&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;go run main.go 
0 0
1 &lt;span class=&quot;nt&quot;&gt;-1&lt;/span&gt;
3 &lt;span class=&quot;nt&quot;&gt;-3&lt;/span&gt;
6 &lt;span class=&quot;nt&quot;&gt;-6&lt;/span&gt;
10 &lt;span class=&quot;nt&quot;&gt;-10&lt;/span&gt;
15 &lt;span class=&quot;nt&quot;&gt;-15&lt;/span&gt;
21 &lt;span class=&quot;nt&quot;&gt;-21&lt;/span&gt;
28 &lt;span class=&quot;nt&quot;&gt;-28&lt;/span&gt;
36 &lt;span class=&quot;nt&quot;&gt;-36&lt;/span&gt;
45 &lt;span class=&quot;nt&quot;&gt;-45&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Fibonacci series
&lt;/h2&gt;

&lt;p&gt;Here is the example of fibonacci series.&lt;br&gt;
initially we are initializing a and b with 0 and 1.&lt;/p&gt;

&lt;p&gt;then with each time calling the function it will return the return value of a.&lt;/p&gt;

&lt;p&gt;and update the value of a and b.&lt;/p&gt;

&lt;p&gt;So, hence creating a fibonacci series.&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight go&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;fmt&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;// fibonacci is a function that returns&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;// a function that returns an int.&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fibonacci&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;ret&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ret&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fibonacci&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;fmt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Println&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;gk@jarvis:~/exp/code/rd/go-exmaple&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;go run main.go 
0
1
1
2
3
5
8
13
21
34
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;In this article we understood how closure is used. closure is a function value that references variables from outside its body.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://hexmos.com/livereview/git-lrc/&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;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%2Fifqf83t1qjl4u0g6aj4l.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;381&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; Check out: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;git-lrc&lt;/a&gt;&lt;br&gt;
Any feedback or contributors are welcome! It&amp;rsquo;s online, open-source, and ready for anyone to use.&lt;br&gt;
&amp;#11088; Star it on GitHub:&lt;br&gt;
&lt;/p&gt;
&lt;div class=&quot;ltag-github-readme-tag&quot;&gt;
  &lt;div class=&quot;readme-overview&quot;&gt;
    &lt;h2&gt;
      &lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg&quot; alt=&quot;GitHub logo&quot;&gt;
      &lt;a href=&quot;https://github.com/HexmosTech&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;
        HexmosTech
      &lt;/a&gt; / &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;
        git-lrc
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Free, Unlimited AI Code Reviews That Run on Commit
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class=&quot;ltag-github-body&quot;&gt;
    
&lt;div class=&quot;md&quot;&gt;
&lt;div&gt;
&lt;a rel=&quot;noopener noreferrer nofollow&quot; href=&quot;https://camo.githubusercontent.com/948c8f2d5cf41b48985cd364d48c3a2dc9bfbfd42eab3e0a9a1b3e61f5f17ce3/68747470733a2f2f6865786d6f732e636f6d2f66726565646576746f6f6c732f7075626c69632f6c725f6c6f676f2e737667&quot;&gt;&lt;img width=&quot;60&quot; alt=&quot;git-lrc logo&quot; src=&quot;https://camo.githubusercontent.com/948c8f2d5cf41b48985cd364d48c3a2dc9bfbfd42eab3e0a9a1b3e61f5f17ce3/68747470733a2f2f6865786d6f732e636f6d2f66726565646576746f6f6c732f7075626c69632f6c725f6c6f676f2e737667&quot;&gt;&lt;/a&gt;
&lt;p&gt;&lt;strong&gt;git-lrc&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Free, Unlimited AI Code Reviews That Run on Commit&lt;/strong&gt;&lt;/p&gt;
&lt;br&gt;
&lt;/div&gt;



&lt;div&gt;
&lt;a href=&quot;https://www.producthunt.com/products/git-lrc?embed=true&amp;amp;utm_source=badge-top-post-badge&amp;amp;utm_medium=badge&amp;amp;utm_campaign=badge-git-lrc&quot; rel=&quot;nofollow noopener noreferrer&quot;&gt;&lt;img alt=&quot;git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt&quot; width=&quot;250&quot; height=&quot;54&quot; src=&quot;https://camo.githubusercontent.com/87bf2d4283c1e0aa99e254bd17fefb1c67c0c0d39300043a243a4aa633b6cecc/68747470733a2f2f6170692e70726f6475637468756e742e636f6d2f776964676574732f656d6265642d696d6167652f76312f746f702d706f73742d62616467652e7376673f706f73745f69643d31303739323632267468656d653d6c6967687426706572696f643d6461696c7926743d31373731373439313730383638&quot;&gt;&lt;/a&gt;
&lt;/div&gt;




&lt;p&gt;AI agents write code fast. They also &lt;em&gt;silently remove logic&lt;/em&gt;, change behavior, and introduce bugs -- without telling you. You often find out in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git-lrc&lt;/code&gt; fixes this.&lt;/strong&gt; It hooks into &lt;code&gt;git commit&lt;/code&gt; and reviews every diff &lt;em&gt;before&lt;/em&gt; it lands. 60-second setup. Completely free.&lt;/p&gt;

&lt;div class=&quot;markdown-heading&quot;&gt;
&lt;h2 class=&quot;heading-element&quot;&gt;See It In Action&lt;/h2&gt;
&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;See git-lrc catch serious security issues such as leaked credentials, expensive cloud
operations, and sensitive material in log statements&lt;/p&gt;
&lt;/blockquote&gt;


  
    

    &lt;span class=&quot;m-1&quot;&gt;git-lrc-intro-60s.mp4&lt;/span&gt;
  

  

  


&lt;div class=&quot;markdown-heading&quot;&gt;
&lt;h2 class=&quot;heading-element&quot;&gt;Why&lt;/h2&gt;

&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt; &lt;strong&gt;AI agents silently break things.&lt;/strong&gt; Code removed. Logic changed. Edge cases gone. You won't notice until production.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Catch it before it ships.&lt;/strong&gt; AI-powered inline comments show you &lt;em&gt;exactly&lt;/em&gt; what changed and what looks wrong.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Build a habit, ship better code.&lt;/strong&gt; Regular review &amp;rarr; fewer bugs &amp;rarr; more robust code &amp;rarr; better results in your team.&lt;/li&gt;

&lt;li&gt; &lt;strong&gt;Why git?&lt;/strong&gt; Git is universal. Every editor, every IDE, every AI&amp;hellip;&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class=&quot;gh-btn-container&quot;&gt;&lt;a class=&quot;gh-btn&quot; href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;



</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/13380/understanding-closures-in-go</guid>
<pubDate>Mon, 23 Mar 2026 10:11:14 +0000</pubDate>
</item>
<item>
<title>What I’m Doing to Not Become Irrelevant</title>
<link>https://coderlegion.com/11285/what-im-doing-to-not-become-irrelevant</link>
<description>
&lt;p&gt;I wrote recently about the &lt;a rel=&quot;nofollow&quot; href=&quot;https://sudoish.com/the-developer-identity-crisis/&quot;&gt;developer identity crisis&lt;/a&gt;. The weird feeling of watching AI do the work we spent years learning to do ourselves.&lt;/p&gt;



&lt;p&gt;But naming the problem isn&amp;rsquo;t enough. I&amp;rsquo;ve been thinking about what to actually do about it. What habits keep us sharp. What makes a developer valuable when the execution layer is being automated.&lt;/p&gt;



&lt;p&gt;I don&amp;rsquo;t have all the answers. But I&amp;rsquo;ve been experimenting. Here&amp;rsquo;s what I&amp;rsquo;m trying.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;I Still Write Code By Hand&lt;/h2&gt;



&lt;figure class=&quot;wp-block-image&quot;&gt;&lt;img src=&quot;https://media.tenor.com/QOwd1e1o-9sAAAAC/croginal-hacking.gif&quot; alt=&quot;&quot;&gt;&lt;/figure&gt;



&lt;p&gt;There&amp;rsquo;s a real risk in the AI-assisted workflow: you stop coding.&lt;/p&gt;



&lt;p&gt;I noticed it happening to me. Language features I used to know cold got fuzzy. I was slower without the AI. Rustier. Looking up things that used to be automatic.&lt;/p&gt;



&lt;p&gt;So I started doing LeetCode again. Not because I&amp;rsquo;m interviewing anywhere. Just to keep the muscle memory alive.&lt;/p&gt;



&lt;p&gt;It feels a bit like practicing flatground tricks at an empty parking lot. Nobody&amp;rsquo;s filming you do kickflips for Instagram there. But if you stop drilling the basics, your whole game falls apart when it actually matters.&lt;/p&gt;



&lt;p&gt;I&amp;rsquo;m not trying to compete with AI on speed. I gave up on that. But I need to keep my judgment sharp enough to evaluate what the AI produces. And that requires actually understanding code at a level you can only maintain by writing it.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;I&amp;rsquo;m Learning to Be Visible&lt;/h2&gt;



&lt;figure class=&quot;wp-block-image&quot;&gt;&lt;img src=&quot;https://media.tenor.com/W9bED0slZ3gAAAAC/look-at-me-alma-fillcot.gif&quot; alt=&quot;&quot;&gt;&lt;/figure&gt;



&lt;p&gt;This one feels uncomfortable to write about. I&amp;rsquo;m not naturally someone who promotes their work. I always figured good work speaks for itself.&lt;/p&gt;



&lt;p&gt;It doesn&amp;rsquo;t. Not anymore.&lt;/p&gt;



&lt;p&gt;When AI can theoretically do what you do, you need to show that you&amp;rsquo;re the one making things happen. Not in a braggy way. Just&amp;hellip; clearly. Document your decisions. Share your thinking in PRs and meetings. Write about what you&amp;rsquo;re learning.&lt;/p&gt;



&lt;p&gt;If your work is invisible, people will assume AI could replace you. Maybe not consciously. But when cuts happen, the people nobody notices are the first to go.&lt;/p&gt;



&lt;p&gt;I&amp;rsquo;m still figuring out how to do this without feeling gross about it. But I&amp;rsquo;ve accepted that it&amp;rsquo;s part of the job now.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;Every Developer Is Becoming a Team Lead&lt;/h2&gt;



&lt;figure class=&quot;wp-block-image&quot;&gt;&lt;img src=&quot;https://media.tenor.com/8gpE4w4oJVMAAAAC/conducting-eric-cartman.gif&quot; alt=&quot;&quot;&gt;&lt;/figure&gt;



&lt;p&gt;Here&amp;rsquo;s a weird realization I had: the skills for leading AI agents are the same skills for leading people.&lt;/p&gt;



&lt;p&gt;Breaking down ambiguous problems into clear tasks. Providing enough context so others can execute well. Reviewing work and course-correcting. Unblocking progress. Communicating status.&lt;/p&gt;



&lt;p&gt;That&amp;rsquo;s management. That&amp;rsquo;s tech leading. And now that&amp;rsquo;s also&amp;hellip; prompting?&lt;/p&gt;



&lt;p&gt;If you&amp;rsquo;re orchestrating a bunch of AI agents, you&amp;rsquo;re basically running a team. A very fast, very literal team that does exactly what you say. Which means you better say the right things.&lt;/p&gt;



&lt;p&gt;The upside is that you have more resources than ever. You can be bolder with what you take on because you have the capacity to actually execute it. But only if you know how to lead.&lt;/p&gt;



&lt;p&gt;Communication skills, leadership skills. These were always important. Now they&amp;rsquo;re the whole job.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;I Keep a Dev Journal&lt;/h2&gt;



&lt;figure class=&quot;wp-block-image&quot;&gt;&lt;img src=&quot;https://media.tenor.com/5tUrNefPezYAAAAC/writing-notes-aitch.gif&quot; alt=&quot;&quot;&gt;&lt;/figure&gt;



&lt;p&gt;This is maybe the simplest habit, and it makes all the others easier.&lt;/p&gt;



&lt;p&gt;Every day I write down what I worked on. What I accomplished. What went wrong. What decisions I made and why.&lt;/p&gt;



&lt;p&gt;It sounds basic. But when AI does the implementation, it&amp;rsquo;s easy to lose track of your own contributions. The journal anchors it.&lt;/p&gt;



&lt;p&gt;It also makes 1:1s with my manager way easier. Performance reviews too. Instead of scrambling to remember what I did six months ago, I just look it up. I have receipts.&lt;/p&gt;



&lt;p&gt;And there&amp;rsquo;s something about writing things down that creates clarity. I notice patterns. I see when I&amp;rsquo;m spinning my wheels. I catch myself before I waste a week on something that doesn&amp;rsquo;t matter.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;I Automated My Morning Planning&lt;/h2&gt;



&lt;figure class=&quot;wp-block-image&quot;&gt;&lt;img src=&quot;https://media.tenor.com/o_HbI30rkSwAAAAC/checklist-to-do-list.gif&quot; alt=&quot;&quot;&gt;&lt;/figure&gt;



&lt;p&gt;This is the meta move: using AI to help me stay relevant in the AI era.&lt;/p&gt;



&lt;p&gt;I set up an automation with &lt;a rel=&quot;nofollow&quot; href=&quot;https://openclaw.ai/&quot;&gt;OpenClaw&lt;/a&gt; that runs every morning. It gathers context from my work. What&amp;rsquo;s in progress, what&amp;rsquo;s blocked, what the priorities are. Then it suggests where I should focus, how I can help unblock others, and how to communicate my impact without being annoying about it.&lt;/p&gt;



&lt;p&gt;The output is a day plan broken into pomodoros. I know exactly what I&amp;rsquo;m doing and when.&lt;/p&gt;



&lt;p&gt;Before this, I&amp;rsquo;d start my day scattered. Check Slack. Check email. Context-switch for an hour before doing anything useful. Now I start with clarity.&lt;/p&gt;



&lt;p&gt;It&amp;rsquo;s not about working harder. It&amp;rsquo;s about not wasting time figuring out what to work on.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;I Do Things That Aren&amp;rsquo;t Work&lt;/h2&gt;



&lt;figure class=&quot;wp-block-image&quot;&gt;&lt;img src=&quot;https://media.tenor.com/bIuUKXJx-mgAAAAC/carving-on-a-skateboard-minna-stess.gif&quot; alt=&quot;&quot;&gt;&lt;/figure&gt;



&lt;p&gt;I almost didn&amp;rsquo;t include this one because it sounds like generic self-help advice. But it&amp;rsquo;s been more important than I expected.&lt;/p&gt;



&lt;p&gt;The temptation when everything is changing is to grind harder. Learn more. Stay online longer. Keep up with every new tool, every new technique, every new AI model drop.&lt;/p&gt;



&lt;p&gt;That&amp;rsquo;s a trap.&lt;/p&gt;



&lt;p&gt;I skate. Have for years. And I&amp;rsquo;ve noticed something: the days I get on my board, I&amp;rsquo;m better at my job. Not despite the time away from the screen. Because of it.&lt;/p&gt;



&lt;p&gt;There&amp;rsquo;s something about skateboarding that clears my head in a way nothing else does. You can&amp;rsquo;t think about work when you&amp;rsquo;re trying to land a trick. You can&amp;rsquo;t worry about AI taking your job when you&amp;rsquo;re focused on not eating concrete. It forces presence.&lt;/p&gt;



&lt;p&gt;And when I come back to work, I think more clearly. I make better decisions. I&amp;rsquo;m less reactive, less anxious about all the change happening around us.&lt;/p&gt;



&lt;p&gt;I&amp;rsquo;ve noticed the opposite too. When I skip skating for a few weeks, when I&amp;rsquo;m just grinding at the computer every day, I get worse. Not better. My thinking gets foggy. I burn out on things I used to enjoy. I make dumber calls.&lt;/p&gt;



&lt;p&gt;If your whole identity is &amp;ldquo;developer,&amp;rdquo; and that identity feels threatened, you&amp;rsquo;re going to spiral. Having something else gives you stability. A sport, a hobby, anything that pulls you out of your head. A foundation that doesn&amp;rsquo;t shake every time a new model drops.&lt;/p&gt;



&lt;p&gt;Take care of yourself. The developers who burn out won&amp;rsquo;t be around to see what happens next.&lt;/p&gt;



&lt;h2 class=&quot;wp-block-heading&quot;&gt;The Common Thread&lt;/h2&gt;



&lt;p&gt;All of this requires being intentional. That&amp;rsquo;s the actual habit underneath the habits.&lt;/p&gt;



&lt;p&gt;The developers who fall behind will be the ones who just let things happen to them. Who assume their skills stay relevant automatically. Who keep doing what they&amp;rsquo;ve always done because it worked before.&lt;/p&gt;



&lt;p&gt;The job changed. We have to change with it. Not by panicking, but by building habits that keep us sharp, visible, and grounded.&lt;/p&gt;



&lt;p&gt;I don&amp;rsquo;t know if I&amp;rsquo;m doing it right. But I&amp;rsquo;m trying.&lt;/p&gt;
&lt;p&gt;The post &lt;a rel=&quot;nofollow&quot; href=&quot;https://sudoish.com/what-im-doing-to-not-become-irrelevant/&quot;&gt;What I&amp;rsquo;m Doing to Not Become Irrelevant&lt;/a&gt; appeared first on &lt;a rel=&quot;nofollow&quot; href=&quot;https://sudoish.com&quot;&gt;sudoish&lt;/a&gt;.&lt;/p&gt;

</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/11285/what-im-doing-to-not-become-irrelevant</guid>
<pubDate>Mon, 09 Feb 2026 04:22:53 +0000</pubDate>
</item>
<item>
<title>Unveiling My Digital Arsenal: What I Use</title>
<link>https://coderlegion.com/1560/unveiling-my-digital-arsenal-what-i-use</link>
<description>
&lt;p&gt;Welcome, to my digital sanctuary! In this ever-evolving landscape of technology, I've carved out my own niche, a haven where innovation meets productivity, and creativity thrives. Join me on this journey as I peel back the layers of my digital realm, revealing the tools, hardware, and development stack that power my every endeavor.&lt;/p&gt;
&lt;h2&gt;Inside My Workstation:&lt;/h2&gt;
&lt;p&gt;Step into my workspace, where innovation takes flight. Here, &lt;a rel=&quot;nofollow&quot; href=&quot;https://archlinux.org/&quot;&gt;Arch Linux&lt;/a&gt; reigns supreme, providing the solid foundation upon which my digital adventures unfold. Paired with the sleek efficiency of &lt;a rel=&quot;nofollow&quot; href=&quot;https://i3wm.org/&quot;&gt;i3wm&lt;/a&gt;, navigating through tasks feels effortless, like a well-choreographed dance. When it's time to delve into the intricate world of code, &lt;a rel=&quot;nofollow&quot; href=&quot;https://neovim.io/&quot;&gt;neovim&lt;/a&gt; emerges as my stalwart companion, guiding my fingers through lines of logic and creativity. And for traversing the vast expanses of the internet, I rely on the steadfast companionship of &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.mozilla.org/en-US/firefox/&quot;&gt;Firefox&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.google.com/intl/en_in/chrome/&quot;&gt;Google Chrome&lt;/a&gt; (only used while developing websites), guiding me through the digital wilderness with ease.&lt;/p&gt;
&lt;p&gt;If you're curious about the intricate workings of my workspace, feel free to take a peek at &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/nnisarggada/i3-dots&quot;&gt;my i3 configuration&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://nnisarg.in/images/blog/what-i-use.jpg&quot; alt=&quot;My Linux Setup&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Hardware Highlights:&lt;/h2&gt;
&lt;p&gt;Beneath the surface of this digital tapestry lies a robust infrastructure, meticulously crafted to support my every endeavor. At its core, a &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.amd.com/en/products/cpu/amd-ryzen-5-3500x&quot;&gt;AMD Ryzen 5 3500X&lt;/a&gt; CPU, coupled with a &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.nvidia.com/en-us/geforce/graphics-cards/16-series/&quot;&gt;Nvidia GeForce GTX 1660 Super&lt;/a&gt; GPU, form the beating heart of this technological marvel, ensuring smooth sailing whether I'm engaged in intense work or immersive gaming experiences. 16GB of &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.corsair.com/us/en/p/memory/cmk16gx4m2d3200c16/vengeancea-lpx-16gb-2-x-8gb-ddr4-dram-3200mhz-c16-memory-kit-black-cmk16gx4m2d3200c16&quot;&gt;Corsair Vengance LPX 3200MHz DDR4&lt;/a&gt; RAM keeps the gears turning seamlessly, while my &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.viewsonic.com/global/products/lcd/VA2406-MH&quot;&gt;ViewSonic VA2406-MH&lt;/a&gt; monitor delivers crisp visuals that breathe life into every pixel.&lt;/p&gt;
&lt;p&gt;For input, I've forged a custom &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/foostan/crkbd&quot;&gt;Corne Split Keyboard&lt;/a&gt;, a testament to personalization and ergonomic excellence. When it's time to envelop myself in the world of sound, I alternate between the &lt;a rel=&quot;nofollow&quot; href=&quot;https://crossbeats.com/products/roar-headphone&quot;&gt;CrossBeats Roar 2.0&lt;/a&gt; for travel and the &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.audio-technica.com/en-eu/ath-m40x&quot;&gt;Audio-Technica ATH M40X&lt;/a&gt; headphones for immersive experiences. And in the realm of communication, the &lt;a rel=&quot;nofollow&quot; href=&quot;https://fifinemicrophone.com/products/fifine-ampligame-usb-microphone&quot;&gt;Fifine Ampligame A6V&lt;/a&gt; mic and &lt;a rel=&quot;nofollow&quot; href=&quot;https://redragon.in/products/hitman-gw800-webcam-with-built-in-dual-microphone&quot;&gt;Redragon Hitman GW800&lt;/a&gt; webcam stand as guardians, ensuring seamless connectivity in a world that thrives on collaboration.&lt;/p&gt;
&lt;p&gt;On the go, my &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.samsung.com/in/smartphones/galaxy-a/galaxy-a23-light-blue-128gb-sm-a235flbtins/&quot;&gt;Samsung Galaxy A23&lt;/a&gt; keeps me tethered to the digital pulse of the world. Also, my old &lt;a rel=&quot;nofollow&quot; href=&quot;https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/300-series/330-15ikb-type-81de&quot;&gt;81DE Lenovo ideapad 330-15IKB&lt;/a&gt; laptop is used as a server via &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.cloudflare.com/products/tunnel/&quot;&gt;Cloudflare Tunnels&lt;/a&gt; and it steps up to the plate, ready to provide my coded creations to the world!&lt;/p&gt;
&lt;h2&gt;Development Stack:&lt;/h2&gt;
&lt;p&gt;In the realm of development, I've curated a stack that seamlessly blends efficiency with creativity, empowering me to bring my ideas to life with unparalleled finesse. With &lt;a rel=&quot;nofollow&quot; href=&quot;https://astro.build/&quot;&gt;Astro&lt;/a&gt; as my frontend framework, crafting dynamic web experiences becomes a joyous endeavor, with limitless possibilities at my fingertips. &lt;a rel=&quot;nofollow&quot; href=&quot;https://tailwindcss.com/&quot;&gt;TailwindCSS&lt;/a&gt;, complemented by a touch of custom CSS, lends a touch of elegance and flair to my creations, ensuring they captivate and inspire. And when it's time to delve into the depths of backend development, &lt;a rel=&quot;nofollow&quot; href=&quot;https://flask.palletsprojects.com/&quot;&gt;Flask&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://fastapi.tiangolo.com/&quot;&gt;FastAPI&lt;/a&gt; emerge as the unsung heroes, providing the flexibility and performance necessary to breathe life into my projects.&lt;/p&gt;
&lt;p&gt;That's but a glimpse into the intricate tapestry of technology that fuels my productivity and creativity. Feel free to explore further or &lt;a rel=&quot;nofollow&quot; href=&quot;mailto:contact@nnisarg.in&quot;&gt;drop me a line&lt;/a&gt; if you're curious about anything specific!&lt;/p&gt;

</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/1560/unveiling-my-digital-arsenal-what-i-use</guid>
<pubDate>Tue, 18 Mar 2025 21:50:10 +0000</pubDate>
</item>
</channel>
</rss>