<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[The 60-Second Programmer - Medium]]></title>
        <description><![CDATA[Quick, actionable programming tips and insights delivered in just 60 seconds. Perfect for developers who want to learn on the go. Whether you’re a beginner or seasoned pro, our bite-sized lessons fit your schedule and boost your coding skills fast! - Medium]]></description>
        <link>https://medium.com/the-60-second-programmer?source=rss----bfb12ca1d1bb---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>The 60-Second Programmer - Medium</title>
            <link>https://medium.com/the-60-second-programmer?source=rss----bfb12ca1d1bb---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 06 Nov 2026 02:11:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/the-60-second-programmer" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[How Hash Maps Work ️]]></title>
            <link>https://medium.com/the-60-second-programmer/how-hash-maps-work-%EF%B8%8F-17e9eabfd9bc?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/17e9eabfd9bc</guid>
            <category><![CDATA[hashmap]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[dictionary]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Wed, 04 Nov 2026 09:26:01 GMT</pubDate>
            <atom:updated>2026-11-04T09:26:01.718Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why a dictionary can find a key in roughly one step.</h4><p>A hash map (dict, hash table) stores key-value pairs and finds any key in roughly <strong>O(1)</strong> time. The trick is turning the key into an array index.</p><h3>The core idea</h3><p>1. A <strong>hash function</strong> converts your key into a number.<br>2. That number maps to a <strong>bucket</strong> (an index in an internal array).<br>3. The value gets stored in that bucket — so lookup goes straight there.</p><pre>def bucket_index(key, size):<br>    return hash(key) % size   # turn key into an array index</pre><pre># Conceptually:<br>buckets = [[] for _ in range(8)]<br>def put(key, value):<br>    buckets[bucket_index(key, 8)].append((key, value))</pre><h3>Collisions</h3><p>Two keys can land in the same bucket. Maps handle this by <strong>chaining</strong> (storing a small list per bucket) or <strong>open addressing</strong> (probing for the next free slot). With a good hash function, collisions stay rare and lookups stay fast.</p><h3>When it slows down</h3><p>If too many keys crowd into too few buckets, lookups degrade toward <strong>O(n)</strong>. Real implementations <strong>resize</strong> (rehash into a bigger array) once they get too full, keeping operations near constant time on average.</p><p><strong>TL;DR:</strong> A hash map turns keys into array indices via a hash function, giving average O(1) lookup — collisions and resizing are the details that keep it honest.</p><p>Reach for a dict whenever you find yourself scanning a list to find one item.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17e9eabfd9bc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/how-hash-maps-work-%EF%B8%8F-17e9eabfd9bc">How Hash Maps Work 🗺️</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Union & Literal Types ]]></title>
            <link>https://medium.com/the-60-second-programmer/union-literal-types-9a8e590d4dcb?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/9a8e590d4dcb</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[type]]></category>
            <category><![CDATA[unions]]></category>
            <category><![CDATA[type-safety]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 09:21:01 GMT</pubDate>
            <atom:updated>2026-11-02T09:21:01.751Z</atom:updated>
            <content:encoded><![CDATA[<h4>Model ‘one of these exact values’ precisely.</h4><p>A union (|) says a value is <em>one of several</em> types. A literal type narrows it to <em>one exact value</em>. Together they&#39;re TypeScript&#39;s superpower.</p><h3>Literal types</h3><p>Instead of string, accept only specific strings:</p><pre>type Direction = &quot;up&quot; | &quot;down&quot; | &quot;left&quot; | &quot;right&quot;;</pre><pre>function move(d: Direction) { /* ... */ }</pre><pre>move(&quot;up&quot;);   // ok<br>move(&quot;north&quot;); // error: not a Direction</pre><h3>Narrowing</h3><p>TypeScript narrows the type as you check it:</p><pre>type Status = &quot;loading&quot; | &quot;success&quot; | &quot;error&quot;;</pre><pre>function render(s: Status) {<br>  if (s === &quot;error&quot;) {<br>    // s is &quot;error&quot; here<br>    return &quot;Something broke&quot;;<br>  }<br>  return s; // s is &quot;loading&quot; | &quot;success&quot;<br>}</pre><p>Combine with switch for exhaustive handling — every case covered, compiler-verified.</p><p><strong>TL;DR:</strong> Unions + literals replace loose string/number with a precise set of allowed values.</p><p>Swap a stringly-typed parameter for a literal union and watch the bugs vanish.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a8e590d4dcb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/union-literal-types-9a8e590d4dcb">Union &amp; Literal Types 🔀</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Goroutines Explained ]]></title>
            <link>https://medium.com/the-60-second-programmer/goroutines-explained-5ee853a93ea3?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/5ee853a93ea3</guid>
            <category><![CDATA[goroutines]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[concurrency]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 09:16:01 GMT</pubDate>
            <atom:updated>2026-10-30T09:16:01.574Z</atom:updated>
            <content:encoded><![CDATA[<h4>Concurrency that costs almost nothing to start.</h4><p>Want to run something concurrently in Go? Put go in front of it. Done.</p><h3>What is a goroutine?</h3><p>A goroutine is a lightweight thread managed by the Go runtime. They start with a tiny stack (a few KB) and grow as needed, so you can spawn thousands without breaking a sweat. The scheduler multiplexes them onto OS threads for you.</p><h3>Starting one</h3><pre>package main</pre><pre>import (<br>	&quot;fmt&quot;<br>	&quot;sync&quot;<br>)</pre><pre>func main() {<br>	var wg sync.WaitGroup<br>	for i := 0; i</pre><h3>Watch out</h3><p>main returning kills every goroutine, so coordinate with sync.WaitGroup or a channel. Goroutines run independently. Use channels or mutexes to share data safely. Capture loop variables explicitly (pass i as an argument) unless you&#39;re on Go 1.22+.</p><p><strong>TL;DR:</strong> go f() launches concurrent work; use WaitGroup or channels to wait for it.</p><p>Try spawning 1,000 goroutines and watch how fast they finish. 🐹</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ee853a93ea3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/goroutines-explained-5ee853a93ea3">Goroutines Explained 🚀</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LLMs Explained ]]></title>
            <link>https://medium.com/the-60-second-programmer/llms-explained-13a6d2493fec?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/13a6d2493fec</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[fundamentals]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 09:06:01 GMT</pubDate>
            <atom:updated>2026-10-28T09:06:01.493Z</atom:updated>
            <content:encoded><![CDATA[<h4>What a large language model actually does, in plain terms.</h4><p>An <strong>LLM</strong> (Large Language Model) is a neural network trained on huge amounts of text to predict the next token. That’s it. Everything else — answering questions, writing code, summarizing — emerges from doing that one thing extremely well.</p><h3>How it works</h3><p>Your text is split into <strong>tokens</strong> (roughly word-fragments). The model assigns a probability to every possible next token, picks one, appends it, and repeats. A paragraph is just the model running that prediction step hundreds of times.</p><pre>&quot;The capital of France is&quot; → [Paris: 0.92] [Lyon: 0.01] ... → &quot;Paris&quot;</pre><h3>What it is NOT</h3><p>Not a database — it doesn’t “look up” facts; it predicts plausible text, so it can be wrong (a “hallucination”). Not deterministic by default — sampling makes outputs vary between runs. Not stateful — each request is independent. You resend the full conversation every time.</p><h3>Calling one</h3><pre>import anthropic</pre><pre>client = anthropic.Anthropic()<br>resp = client.messages.create(<br>    model=&quot;claude-opus-4-8&quot;,<br>    max_tokens=1024,<br>    messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Explain an LLM in one sentence.&quot;}],<br>)<br>print(resp.content[0].text)</pre><p><strong>TL;DR:</strong> An LLM is a next-token predictor trained at scale — powerful, but it generates plausible text, not verified truth.</p><p>Try one against a real prompt before you trust it for anything that matters. →</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13a6d2493fec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/llms-explained-13a6d2493fec">LLMs Explained 🧠</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[em vs rem Explained ]]></title>
            <link>https://medium.com/the-60-second-programmer/em-vs-rem-explained-8234797a5193?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/8234797a5193</guid>
            <category><![CDATA[remote-work]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[me]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 03:41:01 GMT</pubDate>
            <atom:updated>2026-10-26T03:41:01.516Z</atom:updated>
            <content:encoded><![CDATA[<h4>Two relative units — one inherits, one stays fixed to the root.</h4><p>Both are relative font-size units, but they measure against different things — and that difference matters.</p><h3>em → relative to the parent</h3><p>1em equals the <strong>parent element&#39;s</strong> font size. So em values compound as you nest.</p><pre>.parent { font-size: 20px; }<br>.child  { font-size: 1.5em; } /* 30px */<br>.grandchild { font-size: 1.5em; } /* 45px — compounds! */</pre><p>That cascading can surprise you when components nest deeply.</p><h3>rem → relative to the root</h3><p>1rem always equals the <strong>root</strong> (&lt;html&gt;) font size, no matter how deep you are. No compounding.</p><pre>html { font-size: 16px; }<br>.title { font-size: 2rem;  } /* always 32px */<br>.body  { font-size: 1rem;  } /* always 16px */</pre><h3>When to use which</h3><p>rem for font sizes and most layout — predictable and accessibility-friendly (it respects the user&#39;s browser font setting). em for spacing that <em>should</em> scale with its own text, like button padding:</p><pre>.btn {<br>  font-size: 1.25rem;<br>  padding: 0.5em 1em; /* scales with the button&#39;s text */<br>}</pre><p><strong>TL;DR:</strong> Use rem for consistent, accessible sizing; reach for em when you want a value to scale with its local font size.</p><p>Set padding in em on a button, then bump its font-size — the padding scales right along with it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8234797a5193" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/em-vs-rem-explained-8234797a5193">em vs rem Explained 📏</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling NULL in SQL ️]]></title>
            <link>https://medium.com/the-60-second-programmer/handling-null-in-sql-%EF%B8%8F-b789e231be28?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/b789e231be28</guid>
            <category><![CDATA[coalesce]]></category>
            <category><![CDATA[database-administration]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-quality]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Fri, 23 Oct 2026 02:36:01 GMT</pubDate>
            <atom:updated>2026-10-23T02:36:01.600Z</atom:updated>
            <content:encoded><![CDATA[<h4>NULL isn’t zero, and it isn’t empty — it’s unknown.</h4><p>NULL means “unknown,” not zero or empty string. Treat it like a value and your filters quietly drop rows.</p><h3>NULL breaks equality</h3><p>Comparisons with NULL return <em>unknown</em>, never true:</p><pre>-- These NEVER match, even when the column is NULL:<br>WHERE status = NULL      -- wrong<br>WHERE status != &#39;active&#39; -- silently skips NULL rows!</pre><pre>-- Use IS NULL / IS NOT NULL instead:<br>WHERE status IS NULL<br>WHERE status IS NOT NULL;</pre><p>Because status != &#39;active&#39; is <em>unknown</em> for NULL rows, they get excluded. Add OR status IS NULL if you want them.</p><h3>COALESCE picks the first non-NULL</h3><p>Supply a fallback so NULLs don’t poison your output or math:</p><pre>SELECT<br>  name,<br>  COALESCE(nickname, name)        AS display_name,<br>  COALESCE(discount, 0) * price   AS amount_off<br>FROM users;</pre><p>COALESCE(discount, 0) turns a NULL discount into 0, so the multiplication stays a number instead of becoming NULL.</p><h3>Gotchas</h3><p>NULL + 5 is NULL. Any arithmetic with NULL is NULL. COUNT(col) skips NULLs; COUNT(*) counts every row. NULL = NULL is <em>unknown</em>. Use IS NOT DISTINCT FROM to treat two NULLs as equal.</p><p><strong>TL;DR:</strong> Use IS NULL / IS NOT NULL to test for NULL, and COALESCE to supply a default.</p><p>👉 Scan your WHERE clauses for != — they’re probably hiding NULL rows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b789e231be28" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/handling-null-in-sql-%EF%B8%8F-b789e231be28">Handling NULL in SQL 🕳️</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hashing vs Encryption ]]></title>
            <link>https://medium.com/the-60-second-programmer/hashing-vs-encryption-4c32080c2c82?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/4c32080c2c82</guid>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 02:26:01 GMT</pubDate>
            <atom:updated>2026-10-21T02:26:01.582Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why passwords get hashed, not encrypted.</h4><p>They sound similar but solve opposite problems. <strong>Encryption is reversible. Hashing is not.</strong> That one difference decides which to use.</p><h3>Encryption — two-way</h3><p>Encryption scrambles data with a key so it can be <strong>decrypted</strong> back with that key. Use it when you genuinely need the original value later: credit card numbers, private messages, data at rest.</p><h3>Hashing — one-way</h3><p>A hash turns input into a fixed-length fingerprint that <strong>can’t be reversed</strong> back to the original. Same input always gives the same hash. Use it to <em>verify</em> a value without storing the value itself.</p><h3>Why passwords get hashed</h3><p>You never need to know a user’s actual password — only whether the one they typed matches. So you store a hash. If your database leaks, attackers get fingerprints, not passwords.</p><p>Use a slow, salted password hash like <strong>bcrypt</strong> or <strong>argon2</strong> (not fast hashes like MD5 or SHA-256). The salt makes every hash unique, and the slowness makes brute-forcing impractical.</p><pre>import bcrypt</pre><pre># On signup — store this hash, never the password<br>hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt())</pre><pre># On login — compare, don&#39;t decrypt<br>ok = bcrypt.checkpw(attempt.encode(), hashed)</pre><p>bcrypt builds the salt in and verifies by re-hashing the attempt — there&#39;s no &quot;decrypt&quot; step, by design.</p><p><strong>TL;DR:</strong> Encrypt data you need to read back. Hash data you only need to verify — and hash passwords with bcrypt or argon2.</p><p>Open your auth code: if a password is encrypted (or worse, plaintext), switch it to a salted bcrypt/argon2 hash.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c32080c2c82" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/hashing-vs-encryption-4c32080c2c82">Hashing vs Encryption 🔐</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Props vs State ⚛️]]></title>
            <link>https://medium.com/the-60-second-programmer/props-vs-state-%EF%B8%8F-e8a0f436f595?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/e8a0f436f595</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[united-states]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 02:16:01 GMT</pubDate>
            <atom:updated>2026-10-19T02:16:01.661Z</atom:updated>
            <content:encoded><![CDATA[<h4>Two ways data flows — one you own, one you receive.</h4><p>Both hold data a component renders. The difference is <em>who controls it</em>.</p><h3>Props: passed in, read-only</h3><p>A parent passes props down. The child reads them but never reassigns them.</p><pre>function Greeting({ name }) {<br>  return &lt;h1&gt;Hello, {name}!&lt;/h1&gt;;<br>}</pre><pre>&lt;Greeting name=&quot;Ada&quot; /&gt;;</pre><h3>State: owned, changeable</h3><p>State lives inside a component and changes over time via its setter.</p><pre>function Toggle() {<br>  const [on, setOn] = useState(false);<br>  return &lt;button onClick={() =&gt; setOn((o) =&gt; !o)}&gt;{on ? &quot;ON&quot; : &quot;OFF&quot;}&lt;/button&gt;;<br>}</pre><h3>The mental model</h3><p><strong>Props</strong> flow <em>down</em> from parent to child. Immutable to the receiver.<br><strong>State</strong> is <em>local</em> and mutable through its setter.<br>Need to share state? Lift it to the closest common parent and pass it down as props.</p><p><strong>TL;DR:</strong> Props come from above and are read-only; state is owned locally and changes over time.</p><p>Look at a component you wrote — is that data really state, or could it just be a prop? 🤔</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8a0f436f595" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/props-vs-state-%EF%B8%8F-e8a0f436f595">Props vs State ⚛️</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dictionary Tricks Explained ️]]></title>
            <link>https://medium.com/the-60-second-programmer/dictionary-tricks-explained-%EF%B8%8F-1992c948a5f2?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/1992c948a5f2</guid>
            <category><![CDATA[python-dictionaries]]></category>
            <category><![CDATA[writing-tips]]></category>
            <category><![CDATA[comprehensions-in-python]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Fri, 16 Oct 2026 02:11:01 GMT</pubDate>
            <atom:updated>2026-10-16T02:11:01.627Z</atom:updated>
            <content:encoded><![CDATA[<h4>Four dict moves that clean up everyday code.</h4><p>Dicts do far more than d[key]. Here are four habits that remove boilerplate.</p><h3>1. .get() — no more KeyError</h3><pre>user = {&quot;name&quot;: &quot;Ada&quot;}<br>user.get(&quot;age&quot;)          # None (no crash)<br>user.get(&quot;age&quot;, 0)       # 0 (default)</pre><h3>2. .setdefault() — read-or-initialize</h3><p>Great for grouping into lists:</p><pre>groups = {}<br>for word in [&quot;apple&quot;, &quot;ant&quot;, &quot;bee&quot;]:<br>    groups.setdefault(word[0], []).append(word)<br># {&quot;a&quot;: [&quot;apple&quot;, &quot;ant&quot;], &quot;b&quot;: [&quot;bee&quot;]}</pre><h3>3. Dict comprehensions</h3><pre>squares = {n: n * n for n in range(4)}<br># {0: 0, 1: 1, 2: 4, 3: 9}</pre><h3>4. Merge with | (Python 3.9+)</h3><pre>defaults = {&quot;color&quot;: &quot;red&quot;, &quot;size&quot;: &quot;M&quot;}<br>custom = {&quot;size&quot;: &quot;L&quot;}<br>merged = defaults | custom<br># {&quot;color&quot;: &quot;red&quot;, &quot;size&quot;: &quot;L&quot;}  -&gt; right side wins</pre><p><strong>TL;DR:</strong> get avoids KeyErrors, setdefault initializes-and-appends, comprehensions build dicts inline, and | merges them.</p><p>Follow for more 60-second Python breakdowns. 🐍</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1992c948a5f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/dictionary-tricks-explained-%EF%B8%8F-1992c948a5f2">Dictionary Tricks Explained 🗙️</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optional: Stop Returning Null ☔]]></title>
            <link>https://medium.com/the-60-second-programmer/optional-stop-returning-null-e52437708cfd?source=rss----bfb12ca1d1bb---4</link>
            <guid isPermaLink="false">https://medium.com/p/e52437708cfd</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[optionals]]></category>
            <category><![CDATA[kotlin-null-safety]]></category>
            <dc:creator><![CDATA[Marcelo Domingues]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 02:06:01 GMT</pubDate>
            <atom:updated>2026-10-14T02:06:01.565Z</atom:updated>
            <content:encoded><![CDATA[<h4>Make absence explicit instead of dangerous.</h4><p>null is a silent landmine. Optional&lt;T&gt; turns &quot;this might be missing&quot; into part of your method&#39;s signature, so callers can&#39;t ignore it.</p><h3>Why it matters</h3><p>The return type screams “could be empty.”<br>No more reflexive if (x != null) everywhere.<br>Chain transformations without NPEs.</p><h3>The idioms that matter</h3><p>Optional.of(x) for non-null, Optional.ofNullable(x) when it might be null.<br>Use map/filter to transform, orElse/orElseThrow to exit.<br>Never call .get() blindly — that just trades NPE for NoSuchElementException.</p><pre>public Optional&lt;User&gt; findByEmail(String email) {<br>    return repository.lookup(email); // returns Optional&lt;User&gt;<br>}</pre><pre>String name = findByEmail(&quot;a@b.com&quot;)<br>        .map(User::getName)<br>        .filter(n -&gt; !n.isBlank())<br>        .orElse(&quot;Anonymous&quot;);</pre><pre>User user = findByEmail(&quot;a@b.com&quot;)<br>        .orElseThrow(() -&gt; new UserNotFoundException(email));</pre><p>One rule: use Optional for <strong>return types</strong>, not for fields or method parameters.</p><p><strong>TL;DR:</strong> Return Optional&lt;T&gt; instead of null so absence is impossible to overlook.</p><p>Got a method that returns null today? Refactor it to Optional and watch the null-checks disappear.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e52437708cfd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-60-second-programmer/optional-stop-returning-null-e52437708cfd">Optional: Stop Returning Null ☔</a> was originally published in <a href="https://medium.com/the-60-second-programmer">The 60-Second Programmer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>