<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://tanyatree.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://tanyatree.github.io/" rel="alternate" type="text/html" /><updated>2025-10-31T23:03:59+00:00</updated><id>https://tanyatree.github.io/feed.xml</id><title type="html">🌲 Tanya Tree — Learning in Public</title><subtitle>Notes, experiments, and portfolio — Python/Django, patterns, and aha moments.</subtitle><author><name>Tanya Tree</name></author><entry><title type="html">What I Learned About Big O (and why I wish I knew this sooner)</title><link href="https://tanyatree.github.io/2025/10/09/learned-big-o.html" rel="alternate" type="text/html" title="What I Learned About Big O (and why I wish I knew this sooner)" /><published>2025-10-09T13:00:00+00:00</published><updated>2025-10-09T13:00:00+00:00</updated><id>https://tanyatree.github.io/2025/10/09/learned-big-o</id><content type="html" xml:base="https://tanyatree.github.io/2025/10/09/learned-big-o.html"><![CDATA[<p>After more than a decade of coding, I finally had one of those rare “click” moments where everything just made sense. It hit me like a lightning bolt—I realized what <code class="language-plaintext highlighter-rouge">O(n)</code> and <code class="language-plaintext highlighter-rouge">O(1)</code> <em>really</em> mean for my code. It felt like a veil was lifted after years of struggling with concepts that seemed abstract and distant. This discovery didn’t just improve my coding; it helped me fight off imposter syndrome and rekindled my curiosity and excitement for learning.</p>

<p>Sometimes, despite years of experience, it’s easy to feel stuck or doubt your skills. But moments like this remind me that growth is always possible, no matter how long you’ve been coding. It’s never too late to gain new insights that transform how you approach problems.</p>

<p>Here’s what I learned. Let’s take a look at an example from a project I’ve been working on, utopia-crm. We have a model called <code class="language-plaintext highlighter-rouge">Contact</code>, and I needed to match data from a CSV file against this model.</p>

<p>I used to iterate through the CSV and query the database for every row — which is effectively <strong>O(n × query_time)</strong>. After learning about dictionary lookups and preloading contacts by <code class="language-plaintext highlighter-rouge">id_document</code>, I switched to <em>one</em> bulk query + <strong>O(1)</strong> lookups. A script that took minutes now runs in under a second. ⚡</p>

<h3 id="snippet"><strong>Snippet:</strong></h3>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">contacts</span> <span class="o">=</span> <span class="n">Contact</span><span class="p">.</span><span class="n">objects</span><span class="p">.</span><span class="nb">filter</span><span class="p">(</span><span class="n">id_document__in</span><span class="o">=</span><span class="n">ci_list</span><span class="p">)</span>
<span class="n">contact_lookup</span> <span class="o">=</span> <span class="p">{</span><span class="n">c</span><span class="p">.</span><span class="n">id_document</span><span class="p">:</span> <span class="n">c</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">contacts</span><span class="p">}</span>
<span class="n">contact</span> <span class="o">=</span> <span class="n">contact_lookup</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="n">ci_from_csv</span><span class="p">)</span>  <span class="c1"># O(1)
</span></code></pre></div></div>

<h3 id="takeaways"><strong>Takeaways</strong></h3>

<ul>
  <li>Fetch once, reuse many times.</li>
  <li>Build lookup maps (<code class="language-plaintext highlighter-rouge">dict</code>) for joins in memory.</li>
  <li>Control ORM queries with <code class="language-plaintext highlighter-rouge">select_related</code> / <code class="language-plaintext highlighter-rouge">prefetch_related</code>.</li>
</ul>]]></content><author><name>Tanya Tree</name></author><category term="django" /><category term="python" /><category term="bigO" /><category term="learning" /><summary type="html"><![CDATA[After more than a decade of coding, I finally had one of those rare “click” moments where everything just made sense. It hit me like a lightning bolt—I realized what O(n) and O(1) really mean for my code. It felt like a veil was lifted after years of struggling with concepts that seemed abstract and distant. This discovery didn’t just improve my coding; it helped me fight off imposter syndrome and rekindled my curiosity and excitement for learning.]]></summary></entry><entry><title type="html">Imposter Syndrome before and after AI and more</title><link href="https://tanyatree.github.io/2025/10/09/why-now.html" rel="alternate" type="text/html" title="Imposter Syndrome before and after AI and more" /><published>2025-10-09T04:40:00+00:00</published><updated>2025-10-09T04:40:00+00:00</updated><id>https://tanyatree.github.io/2025/10/09/why-now</id><content type="html" xml:base="https://tanyatree.github.io/2025/10/09/why-now.html"><![CDATA[<p>Hello everyone. My name is Tanya. I’m a developer who specializes in Python and Django. It’s around 1:40 AM, and I can’t sleep. My husband and I just finished watching the Washington Capitals game, but while he drifted off, I kept thinking. So here I am, trying to do something that helps me combat my anxiety and the feeling that I haven’t really achieved much in life.</p>

<p>Lately, imposter syndrome has been hitting me hard — especially in this age of AI and automation. These days, if you want a perfect product or just want things done faster, you can ask an AI to do it for you. And sometimes that makes me feel worse. I wonder if I’m really doing enough — even these pages were set up with AI’s help.</p>

<p>Over the years, I’ve faced many challenges as a developer. I’ve had my share of victories and frustrations. I’ve learned a lot, but I’ve never really had someone to look up to — no mentor or role model. That made my programming journey awkward. I had to build myself from scratch, with what I learned at a technical middle school and the little time I spent at university. I picked up patterns by watching others at work without really knowing what they were. I didn’t know what SOLID or design patterns meant — I just followed what everyone else did.</p>

<p>Then AI appeared. ChatGPT, Claude, and others — along with a brief but meaningful time working with a really good tech team — completely changed how I saw programming. I started learning proper practices in Django, exploring class-based views after years of only using functions. I discovered mixins, cleaner designs, SOLID principles, and reusable code.</p>

<p>But the more I learned, the more I felt unprepared to join another team. I kept thinking, what if I’m useless somewhere else? AI was showing me a world I had never seen before — and it’s strange to admit that it feels like AI became the mentor I’d always needed.</p>

<p>Months ago, I started working on a portfolio, but it never went anywhere. My job drains me, and when I’m done, all I want is to rest — or focus on my health and fitness. Still, I’ve decided that’s enough waiting. I’m going to start doing small things for myself again.</p>

<p>I want to share these moments — the realizations of a programmer in her mid-30s who’s still learning, maybe a bit late, but learning nonetheless. One of those moments was when I finally understood Big O notation (I wrote about it here). It hit me hard — I should’ve been thinking this way for years. But better late than never, right?</p>

<p>I know I might sound negative sometimes, but this is just where I am right now. I’ll also share my victories — I don’t want this to be just a blog about anxiety, but about growth too.</p>

<p>Thank you for reading. I hope you’ll join me on this journey.</p>

<p>Tanya</p>

<hr />]]></content><author><name>Tanya Tree</name></author><category term="programming" /><category term="python" /><category term="learning" /><category term="life" /><summary type="html"><![CDATA[Hello everyone. My name is Tanya. I’m a developer who specializes in Python and Django. It’s around 1:40 AM, and I can’t sleep. My husband and I just finished watching the Washington Capitals game, but while he drifted off, I kept thinking. So here I am, trying to do something that helps me combat my anxiety and the feeling that I haven’t really achieved much in life.]]></summary></entry></feed>